$ perl -MO=Deparse,-p -E '%hash = "here" => $_ for grep { -d $_ } qw{. a b c eg}' use feature 'current_sub', 'bitwise', 'evalbytes', 'fc', 'postderef_qq', 'say', 'state', 'switch', 'unicode_strings', 'unicode_eval'; ((%hash = 'here'), $_) foreach (grep({(-d $_);} '.', 'a', 'b', 'c', 'eg')); -e syntax OK