use strict; my %hash = ( 'key01' => '1', 'key02' => '2', 'key03' => '3', ); my $key = 'key01'; if ($key in keys(%hash)) { ### print "$key is in hash"; }