in reply to Not sure how to populate a hash
@$hashref{@keys}=@values
With
$hashref=$nodemetrics{$node}
Not 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 ☆☆☆☆ :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Not sure how to populate a hash
by aditya1977 (Novice) on Sep 24, 2014 at 10:45 UTC | |
by Athanasius (Archbishop) on Sep 24, 2014 at 12:05 UTC | |
by aditya1977 (Novice) on Sep 24, 2014 at 13:23 UTC | |
by LanX (Saint) on Sep 24, 2014 at 13:35 UTC | |
by LanX (Saint) on Sep 24, 2014 at 10:50 UTC | |
by vinoth.ree (Monsignor) on Sep 24, 2014 at 11:50 UTC | |
by Monk::Thomas (Friar) on Sep 24, 2014 at 12:02 UTC |