The square brackets are unnecessary. next unless $path =~ /\.(log|txt)$/;You could also be a little more parsimonious: next unless $path =~ /\.(?:log|txt)$/;Thus avoiding a (presumably unnecessary) capture to $1.
The square brackets are also what made your post render weird. ;-)
In reply to Re: next if regex matches
by VSarkiss
in thread next if regex matches
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |