Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 romping around the Monastery: (5)
As of 2022-08-11 02:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?