Hi all,
After I passed a hash ref to a subroutine, how can I see what the hash
name was? i.e.:
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 keysn";
}
Result:
Hash: HASH(0x297f8) has 2 keys
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.
TIA!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This e-mail and its contents are subject to the Telkom SA Limited
e-mail legal notice available at
http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~