if( grep{ $_ eq 'key1' } keys %hash ) {
print "exists key1 in hash \n";
}

    • grep {} でくくれるのかなるほど。ベストプラクティスにあったかな?