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