I'm parsing a hash, and while I should be keeping them in the hash, there are reasons not to. I dunno. Maybe I should rewrite the program, but in the meantime, I actually want to assign a few of those pairs to variables named after the keys of the hash.
I was hoping I could do something like the following:
or something similar. Is there a way to do this?for my $key ( qw/key1 key2 key3/ ) { eval( "${$key}" ) = $hash{$key}; }
elbieelbieelbie
In reply to Looking for equivalent to LHS eval by elbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |