Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi,
I have a long list of variables to which I want to allocate values. The values to be allocated populate a hash and the keys of the hash are the variable names preceeded by an underscore. i.e. the variable $blastresult needs to be allocated the value accessed by $$self{_blastresult} There are around 20 variables in all so I would like to allocate the values in some sort of foreach loop. For example, using 2 variables for simplicity's sake I would like to do something like: foreach my ($blastresult, $value) {$_ = $$self{_$_};} I can see the reasons why this particular code won't work, but can't see how I can fix it! Any help would be appreciated. Cheers in advance, TB34 In reply to loop to allocate values to variables by travisbickle34
|
|