in reply to apply a regular expression to glob'd filenames

grep is for filtering, map is for transforming.
my @wetrasnfer_fix = map /([0-9]*_[0-9]*)/, @wetransfer;

With 5.14+, you can also use the "return" substitution modifier:

my @wetrasnfer_fix = map s/\.tif$//r, @wetransfer;

Or, you can use split:

my @wetrasnfer_fix = map +(split /\./)[0], @wetransfer;

Note from stevieb: You should also handle the case when not only the chdir fails, but the mail fails, too.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: apply a regular expression to glob'd filenames
by flieckster (Scribe) on Oct 02, 2019 at 14:31 UTC
    ahh, thank you. the map worked perfectly!