Just changed it so that what's being eval'd is a valid perl expression that evaluates to what he wants.%hash = ( 'command' => '"command_name -n $var1 -p $var2"' ); $var1 = 'foo'; $var2 = 'bar'; $command = eval $hash{'command'}; print $command;
In reply to Re: Re: Re: Re: possible to evaluate scalars stored in a string?
by etcshadow
in thread possible to evaluate scalars stored in a string?
by emilford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |