![]() |
|
"be consistent" | |
PerlMonks |
Re: Substituting Variables while reading text fileby aitap (Curate) |
on Aug 07, 2014 at 07:21 UTC ( #1096559=note: print w/replies, xml ) | Need Help?? |
String::Interpolate might be useful in this task. If you move your variables to be interpolated to a hash, you will be able to do it yourself, like this: (untested). What you are writing looks like a templating engine. Unless it's a "homework" question, it might be useful to look at Text::Template, Mason and Template.
In Section
Seekers of Perl Wisdom
|
|