in reply to Delaying interpolation
eval EXPR
eval BLOCK
In the first form, the return value of EXPR is
parsed and executed as if it were a little Perl
program.
So, to return "foo has value $foo" after interpolation, you can do:
Notice the additional double quotes inside the single quotes. This makes eval evalsmy $foo = 7; my $str = eval '"foo has $foo"'; print $str;
"foo has $foo"and returns the resulting string. If you don't include the additional quotes, eval evals
foo has $foowhich is not what you want.
Hope this helps,,,
Aziz,,,
|
|---|