foreach (@files) { process_file $_ if (/foo[34]\.txt$/i or /bar[12]\.txt$/i) }