Don't ask to ask, just ask | |
PerlMonks |
Re: How to populate a HASH using a FOR loop to a FUNCTIONby LanX (Saint) |
on Dec 24, 2014 at 00:24 UTC ( [id://1111259]=note: print w/replies, xml ) | Need Help?? |
Tl;dr but %myHash = &makeHash($key, $val, \%myHash) Skip the left part and you are fine, no need to reset the hash. :) makeHash($key, $val, \%myHash)
updateYour makeHash() is seriously broken. Please have a look at perlref to understand how references work.
updateBetter (among many things)
Cheers Rolf (addicted to the Perl Programming Language and ☆☆☆☆ :)
In Section
Seekers of Perl Wisdom
|
|