in reply to Populate Hash

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:
my %myHash = ();
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.