in reply to Re: Re: Variable expansion
in thread Variable expansion
But the best option would be to have $cmd be interpolated rather than resorting to eval().my $hr = { foo => { bar => '/dev/null' } }; my $cmd_literal = 'ls $hr->{foo}->{bar}'; my $cmd = eval qq(return "$cmd_literal";); print `$cmd`; __output__ /dev/null
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Variable expansion
by stephenpry (Initiate) on Apr 17, 2002 at 14:34 UTC |