$ perl -E 'my %x = (a=>1, b=>2, c=>3); say "Count: ", 0+keys(%x)' Count: 3