in reply to Directory listing

Since you are planning a recursive directory search, I would use File::Find, and put your number search in the wanted() sub.


Dave

Replies are listed 'Best First'.
Re^2: Directory listing
by vek (Prior) on Jan 17, 2005 at 07:36 UTC

    I dunno, for some reason I've always had a hard time getting my head around the API for File::Find. For me, and YMMV, File::Find::Rule is a little more intuitive.

    -- vek --
Re^2: Directory listing
by FireyIce01 (Novice) on Jan 17, 2005 at 04:52 UTC
    Can you give my a syntax example? And how about CPU time, will this take longer than doing an ls and string matching? We've got a lot of folders to go through, and I'm looking for a relatively quick way to do it...

      "ls /usr/local/farms/*/*/input/*$corp*" is not recursive. File::Find isn't incredibly slow if there aren't any subdirectories under /usr/local/farms that aren't matched by /usr/local/farms/*/*/input, but glob is likely to be faster than File::Find.