for my $var (map lc, grep exists $hash_ref->{lc $_}, @vars) { print "Value: " . $hash_ref->{$var} . "\n" ; }