Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: getting the number of hashes

by young perlhopper (Scribe)
on Jul 21, 2000 at 17:20 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found