get size of hash in perl
April 24th, 2007 by Lawrence David
getting the size of a hash is slightly non-intuitive in perl:
print “my hash size is: ” . keys(%my_hash);
April 24th, 2007 by Lawrence David
getting the size of a hash is slightly non-intuitive in perl:
print “my hash size is: ” . keys(%my_hash);
Didn’t know _that_ would work. I would have used scalar(keys(%my_hash)) in that case.