in reply to find a number of keys in a hash

Using keys in scalar context will return the number of keys in the hash:

my $keylen = keys %data; print $keylen;