my $pk = 'Email Address'; if ( defined $h->{$pk} ) { print "key = $h->{$pk}{key}"; # same as $pk print "value = $h->{$pk}{value}"; } else { print "This PK does not exist in this table"; }