If you really cannot use a hash (and that's easily the best way to do this), install PadWalker and use my $lexicals = peek_my(0); to get a hash reference which you can use to manipulate all lexical variables bound to the current scope.
(If manipulating Perl 5 internals from pure Perl still seems less overkill than using a hash, consider that PadWalker can read from and write to and even create lexicals in other scopes, ignoring encapsulation.)
In reply to Re: How can I turn a string into a variable name?
by chromatic
in thread How can I turn a string into a variable name?
by mnooning
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |