in reply to Function to measure size of a hash
I'm using this code, to get some basic informations about the central structures in a software where basically a hash structure is the top/central element:($self points to the hash)
The value is a pointer to an array of some data, therefore the key-value iteration. That way, you get the number of keys and the (total) number of values. (in this case)print "Buckets used/allocated:\t",scalar(%{$self}),"\n"; while(($key,$value) = each %$self) { $num_keys++; $num_mu += scalar(@$value); } print "\t\tNumber Words/meanings:\t$num_keys/$num_mu\n";
Bye
PetaMem
|
|---|