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

.oO( will grep be ok on handling 10000 files?)

Replies are listed 'Best First'.
Re^3: Regex Tuning
by Roy Johnson (Monsignor) on Apr 28, 2005 at 15:17 UTC
    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.