laziness, impatience, and hubris | |
PerlMonks |
Re: creating dynamically named 'my' variablesby rrwo (Friar) |
on Mar 01, 2002 at 04:42 UTC ( [id://148477]=note: print w/replies, xml ) | Need Help?? |
Wait a minute! You want to create variables given names by the user?!?!! That's pretty dangerous, unless you trust the user wholeheartedly. Use a hash instead. You can use symbolic references to do this:
but it doesn't work as a "my variable". In part I think because the scope is limited to within the eval. Ooutside the eval, the variable goes way. I really don't recommend you do this, though.
In Section
Seekers of Perl Wisdom
|
|