You need to eval a string:
my($greeting,$target)=('Hello','World'); my $str = '$greeting $target'; $res=eval "qq{$str}"; print $res __END__ Hello World
In reply to Re^3: Invoke the Perl string interpolation engine on a string contained in a scalar variable.
by Corion
in thread Invoke the Perl string interpolation engine on a string contained in a scalar variable.
by ibm1620
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |