in reply to Push, Matching, and File::Find
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Push, Matching, and File::Find
by Marshall (Canon) on Feb 17, 2010 at 20:10 UTC | |
by ikegami (Patriarch) on Feb 17, 2010 at 22:51 UTC |