in reply to Scanning static directory tree for files

To recursively search directories you should be using the File::Find module.


--
<a href="http://www.dave.org.uk><http://www.dave.org.uk>

European Perl Conference - Sept 22/24 2000
<http://www.yapc.org/Europe/>
  • Comment on Re: Scanning static directory tree for files

Replies are listed 'Best First'.
RE: Re: Scanning static directory tree for files
by raflach (Pilgrim) on Jun 21, 2000 at 16:56 UTC
    unless cross-platform issues are not and issue, and speed is in which case you CAN do it faster by doing it yourself. I don't remember what method turned out to be the fastest when I benchmarked them, but I do remember it wasn't File::Find, and since the requestor is asking for a script for his personal use in learning to program perl he should probably look at all the various methods, and consider their benefits and detriments for his own particular situation.
    Not to rant, but I hate it when people say "If you're doing such-and-such, you should do it this way." as if there weren't a million and a half equally good ways of doing it.
    I admit that I personally don't re-invent the wheel unless I have to. If there's a perfectly good module out there to do the job, I'll generally use it... but I digress.

      OK. TMTOWTDI is key here.

      What I should have said was "you should probably add File::Find the the list of methods you try."


      --
      <a href="http://www.dave.org.uk><http://www.dave.org.uk>

      European Perl Conference - Sept 22/24 2000
      <http://www.yapc.org/Europe/>
        And I would totaly agree that File::Find should be looked at as well.
RE: Re: Scanning static directory tree for files
by royalanjr (Chaplain) on Jun 23, 2000 at 19:12 UTC

    OK, this is a stupid question but.....

    I looked on CPAN for this File::Find module. All I see under File is a bunch of other modules none of which are Find. Am I just brain-challanged, or what?

    Roy Alan

    "I quit; I concede. Tanj on your silly game!" -- Louis Wu

      There's no need to search for it at CPAN as it's been a standard part of Perl for some years. If it's not already installed then there is a problem with your Perl installation.

      --
      <http://www.dave.org.uk>

      European Perl Conference - Sept 22/24 2000
      <http://www.yapc.org/Europe/>

        ouch! told you I was not firing on all cylinders...

        Thanks a ton for the info.

        Roy Alan