in reply to Re: Re: Re: possible to evaluate scalars stored in a string?
in thread possible to evaluate scalars stored in a string?
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: possible to evaluate scalars stored in a string?
by tachyon (Chancellor) on Dec 13, 2003 at 05:07 UTC |