Result:my %hash1 = ( one => 1, two => 2 ); check_limit(\%hash1); sub check_limit { my $hname = $_[0]; my $num = 0; for (keys %{$hname}) { $num++ }; print "Hash: $hname has $num keys\n"; }
The reason I don't pass the whole hash is because these hash-puppies can get quite large and I'd like to avoid copying them. This is just an example of a problem I'm experiencing writing a larger program.Hash: HASH(0x297f8) has 2 keys
In reply to Getting a Hash Name by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |