in reply to Regex Tuning /(?:(?:foo[34])|(?:bar[12]))\.txt/io

I don't see what's so wrong with your code but you could also grep it. Something like (untested):
my @result = map { process_file($_) } grep (/(?:foo[34]|bar[12])\.txt/ +i, @files);

Replies are listed 'Best First'.
Re^2: Regex Tuning
by strictvars (Sexton) on Apr 28, 2005 at 15:00 UTC
    .oO( will grep be ok on handling 10000 files?)
      It will probably be as ok as @files is. It's no worse than a temporary copy of @files (and potentially much smaller, depending on how many match). The questionable thing is the use of map: there's no indication that the OP wants to collect output from process_file (one would think that output would be handled at the time of the call, rather than in bulk afterward).
      process_file($_) for grep /(?:foo[34]|bar[12])\.txt$/io, @files;
      should be fine.

      Caution: Contents may have been coded under pressure.