Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: getting the number of hashes

by young perlhopper (Scribe)
on Jul 21, 2000 at 17:20 UTC ( #23573=note: print w/replies, xml ) Need Help??


in reply to getting the number of hashes

You could store references to all your hashes in a list,
@array = ( \%hash1, \%hash2, \%hash3 );

and then take the size of the array by scalar( @array );
If however, you mean finding the number of keys in a given hash, do this:

$var = keys %hash2;
$var now contains the number of key value pairs in the hash.

-Mark

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://23573]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2023-09-22 18:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?