#!/usr/bin/env perl use strict; use warnings; use List::Util qw{ first }; my %hash = ( ASD => 1, ZXC => 2, QWE => 3, TYU => 4 ); my $val = "qwe"; if(my $res = first { lc $_ eq $val } keys %hash) { print "Found: $res\n"; } else { print "Not found\n"; };