in reply to Re^3: Executing a string as a Perl command
in thread Executing a string as a Perl command
This short illustrative example has $cmd set inline, but in a real program, it could be constructed from other variables, it could be read from a user, it could be read from a file, etc.
The question was simply how to get it to execute once it was set. The answer is eval.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Executing a string as a Perl command
by Anonymous Monk on May 16, 2011 at 11:01 UTC | |
by ctilmes (Vicar) on May 16, 2011 at 13:25 UTC |
In Section
Seekers of Perl Wisdom