On 2012-12-26 19:29, Paul Johnson wrote:
> This is a situation where string eval is warranted:
> 
> eval "\$s =~ s/\$rx/$r/";

... thanks a lot!

Now that I now how it works, I can't believe I couldn't
find the problem!
I had tried string eval too; the real trick that I didn't get
right is that the string to be eval'ed needs to be in double
quotes, because $r (in my example) has to be interpolated
before the eval. I think, I'll go for:
eval qq(\$s="$r");

Regards,
               Peter


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to