![]() |
|
There's more than one way to do things | |
PerlMonks |
Re: Dynamic Variable Names?by RollyGuy (Chaplain) |
on Jul 23, 2002 at 15:34 UTC ( #184452=note: print w/replies, xml ) | Need Help?? |
Try using eval. I've done this with function names before. Your code will look like:
Here I create the command I want to execute as a string and then evaluate it with eval. UPDATE: I just saw dragonchild's comments and realized that my method probably wouldn't be safe for web applications. The eval would be dangerous, so use at your own risk.
In Section
Seekers of Perl Wisdom
|
|