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