Not only does if (//g) doesn't make sense conceptually (search again just to be sure?), it's buggy to do so*. You also seem to be forgetting that "." means something special in a regex pattern. Fix:
push(@file_list, $File::Find::name) if /\.(?:txt|jpg|gif)\z/i && lc($_) ne 'category.txt';
* — while (//g) and if (//gc) are useful, but that's another story.
In reply to Re: Push, Matching, and File::Find
by ikegami
in thread Push, Matching, and File::Find
by JKasting
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |