Tuesday, May 26, 2009

Counting the keys in a Perl hash

I felt silly because I couldn't remember how to count the number of keys in Perl hash - apparently I wasn't the only one:
Counting Keys in a Perl Hash

The quick reminder showed me that the method is:
$count = scalar keys %hash;

No comments:

Post a Comment