You cannot pass the hash as you did without distroying it. It is being flattened into a list. Pass it by reference :
callsub(\%hashtopass); sub callsub { my $hashref = shift; foreach my $k (keys %$hashref) { .. ..
read more about references
In reply to Re: Passing hashes to subs?
by Chady
in thread Passing hashes to subs?
by Massyn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |