go ahead... be a heretic | |
PerlMonks |
Re: Not sure how to populate a hashby LanX (Saint) |
on Sep 24, 2014 at 10:06 UTC ( [id://1101769]=note: print w/replies, xml ) | Need Help?? |
you could use a hash slice to populate many slots at once @$hashref{@keys}=@values With $hashref=$nodemetrics{$node}
updateNot sure why you prepopulate to 0, simply undef seems more robust and is easily done: @$hashref{@keys}=() HTH :)
Cheers Rolf (addicted to the Perl Programming Language and ☆☆☆☆ :)
In Section
Seekers of Perl Wisdom
|
|