my $keys = keys(%my) < 100 ? keys(%mh) : 100; my @k = ( keys %mh )[0..$keys-1];