Syntactic Confectionery Delight | |
PerlMonks |
Re: Populate Hashby markkawika (Monk) |
on Jul 27, 2009 at 16:37 UTC ( [id://783593]=note: print w/replies, xml ) | Need Help?? |
It's because you use the hash %myHash as a global the very first time it's mentioned.
You need to declare it as a local variable with:
Also, you declare it as a hash but then use it as a scalar: $myHash->{$n}=$v; uses the $myHash scalar variable, not the %myHash hash variable.
In Section
Seekers of Perl Wisdom
|
|