in reply to Re: Re: Resolving scalars in a scalar
in thread Resolving scalars in a scalar

Ummm, because your $test is quoted inside double quote, your $test = "D and A" even before you go into the eval, so the eval had no effect.

Change the code slightly as follows -
my $alpha = "A"; my $delta = "D"; my $test = '$delta and $alpha'; eval "\$test = \"$test\""; print "$test";
and yes, it will work this time, because the code is equivalent to -
my $alpha = "A"; my $delta = "D"; my $test = '$delta and $alpha'; $test = "$delta and $alpha"; print "$test";
Where the variable $test inside double quote " " has been expanded by the perl interpreter to the value of $test before going into eval