Has anyone ever though of using Template Toolkit to write perl scripts?
I have a set of scripts for different clients that share perhaps 50% common code. Instead of refactoring and moving the shared code to modules I had a crazy idea about using a set of templates to write out the scripts, with the template filling in the shared bits.
My original idea ran something along these lines:
The code generation approach would have a separate script for each client (all running nicely under Apache::Registry of course) generated by the template and updated (rarely) when the client's data changes. In this case there wouldn't be a script and a template, just the script itself.
This seems an interesting route to follow, though it seems a bit wacky to me. I'll have to think about it a little further and see if I can come up with an example or two. I'm sure there are some big disadvantages which I haven't considered yet