Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Templates on the cheap?by chipmunk (Parson) |
on Nov 29, 2000 at 01:36 UTC ( [id://43780]=note: print w/replies, xml ) | Need Help?? |
Assuming your variable names are well-formed, this is one possibility:
s/\$(\w+)/"\$$1"/gee;
A preferable solution (that was suggested recently in another thread) is to use a hash instead of named variables:
I would lean towards using one of the Template modules, though, for robustness.
In Section
Seekers of Perl Wisdom
|
|