in reply to eval & variable names?

When $v contains "a", you want to execute
$a = $a * 2

Which you means you have to build that string and pass it to the parser (eval EXPR). That can be done using the string literal

"\$$v = \$$v * 2"

So you want

eval "\$$v = \$$v * 2; 1" or die $@;

Replies are listed 'Best First'.
Re^2: eval & variable names?
by Anonymous Monk on Jan 21, 2012 at 00:36 UTC

    Thanks!

    I see that I need to look at the string being passed to eval().

    Thanks, again for slapping me back to reality. I guess it's getting late...