|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Minimal, %ENV based templating toolby blindluke (Hermit) |
| on Nov 08, 2015 at 14:12 UTC ( [id://1147203]=CUFP: print w/replies, xml ) | Need Help?? |
|
There is a nice, minimal templating tool out there, called skel. Its author, Scott Vokes, describes it as a "tiny command-line skeleton/snippet thing", and it's probably accurate. Given a template file name, it expands all the occurences of #{VARIABLE} with the value obtained from the %ENV. The tool has proven quite useful to me, mostly due to the way it provides a lot of useful features while still allowing you to use it in the most primitive way imaginable. Inspired by the simplicity of it, I tried rewriting the most basic version of the idea in Perl, adding the one (the only?) feature I was missing - asking for variable values when the ENV var is unset.
The use is straightforward. Here's an example:
- Luke
Back to
Cool Uses for Perl
|
|
||||||||||||||||||||||||||||||||||||