in reply to Re: Push, Matching, and File::Find
in thread Push, Matching, and File::Find

Not trying to nitpick, but Op used plural for "category.txt files", so in case of housing_category.txt or job_category.txt, I guess we could have a slight change?:
push(@file_list, $File::Find::name) if /\.(?:txt|jpg|gif)\z/i && !/category\.txt\z/i;
Update: well I wasn't exactly sure whether there could be more than one category.txt type file out there. Anyway OP has some solid code (And I really do like the ikegami code). I guess since I'm commenting more, I would point out to the op that "return" looks like what was intended rather than "next" at top of sub.

Replies are listed 'Best First'.
Re^3: Push, Matching, and File::Find
by ikegami (Patriarch) on Feb 17, 2010 at 22:51 UTC

    He said:

    I don't want to grab any files named "category.txt"

    The plural indicate similarly named files could exist in multiple directories.