foreach my $hash ( keys %some ) { next if ( $#{ $some{$hash} } >= 1 ); print $#{ $some{$hash} } . "\n"; }