http://www.perlmonks.org?node_id=979000


in reply to grep & take part of match

Another option is to use the indirect loop of/within map:

my @eFILES = map { substr($_, -3) } grep { (!/^\./) && (/^env\.[a-z]{3}$/) && (!/^env\.fix$ +/)&& -f "$LIBDIR/$_" } readdir( LDIR );