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.