my @result = map { process_file($_) } grep (/(?:foo[34]|bar[12])\.txt/i, @files);