for my $pattern (@patterns) { $good = 1, last if $file =~ /^$pattern$/ }