my @exts; my @eFILES = grep { /^env\.([a-z]{3})$/; push @exts, $1 if $1 && ($_ ne 'env.fix') && -f "$LIBDIR/$_" } readdir(LDIR);
Note that your 1st regex is not needed ((!/^\./)) because you are also checking for env at the start of the string.
Updated to make a little more readable.
In reply to Re: grep & take part of match
by toolic
in thread grep & take part of match
by Saved
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |