http://www.perlmonks.org?node_id=741889


in reply to Re: Evaluating $1 construct in literal replacement expression
in thread Evaluating $1 construct in literal replacement expression

If you mean for example expand "abc $var xyz" so that the string $var is replaced by the value of $var then eval is the only way I know.

my $var = "123"; my $str = 'abc $var def'; my $temp = eval " \"$str;\" "; print "str2:$temp\n";