in reply to Probably an easy one - store command in variable.
This should do what you're looking for:
By the way, eval traps otherwise fatal errors, so pay attention to what's happening with the code being eval'd.
Update:Thanks to everyone for pointing out the scoping and performance problems with eval. It just 'popped in there' like the Stay-Puffed marshmallow man.
eval $command;
By the way, eval traps otherwise fatal errors, so pay attention to what's happening with the code being eval'd.
Update:Thanks to everyone for pointing out the scoping and performance problems with eval. It just 'popped in there' like the Stay-Puffed marshmallow man.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Probably an easy one - store command in variable.
by Codon (Friar) on Sep 15, 2005 at 16:54 UTC | |
by Joost (Canon) on Sep 15, 2005 at 16:58 UTC |
In Section
Seekers of Perl Wisdom