Just another Perl shrine | |
PerlMonks |
Re: "eval" variable in non-perl statment?by c-era (Curate) |
on Mar 29, 2001 at 00:32 UTC ( [id://67935]=note: print w/replies, xml ) | Need Help?? |
You should used a module (like the template toolkit), but for something really simple (or for fun), you can use a regex:
$input =~ s/(\$.*?) /eval ("\$tmp = $1;"); "$tmp "/e;
Note, this code is easy to break, you can't have any other $, and you need to be careful about line breaks.
In Section
Seekers of Perl Wisdom
|
|