Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting a Hash Name
by jonadab (Parson) on Jul 04, 2005 at 12:31 UTC | |
|
Re: Getting a Hash Name
by holli (Abbot) on Jul 04, 2005 at 11:21 UTC | |
|
Re: Getting a Hash Name
by polettix (Vicar) on Jul 04, 2005 at 11:27 UTC | |
by Thilosophy (Curate) on Jul 04, 2005 at 12:19 UTC | |
|
Re: Getting a Hash Name
by Dietz (Curate) on Jul 04, 2005 at 11:38 UTC | |
|
Re: Getting a Hash Name
by Hena (Friar) on Jul 04, 2005 at 11:46 UTC | |
|
Re: Getting a Hash Name
by salva (Canon) on Jul 04, 2005 at 12:06 UTC | |
|
Re: Getting a Hash Name
by TomDLux (Vicar) on Jul 04, 2005 at 15:34 UTC | |
|
Re: Getting a Hash Name
by magnus (Pilgrim) on Jul 04, 2005 at 11:46 UTC | |
by chromatic (Archbishop) on Jul 04, 2005 at 20:26 UTC | |
|
Re: Getting a Hash Name
by Anonymous Monk on Jul 05, 2005 at 01:52 UTC |