in reply to Scanning static directory tree for files

Be very careful that merlyn doesn't see this.

He gets very, very touchy about recursive searches and possible infinite loops.

Look into File::Find. It's amazing.

J. J. Horner
Linux, Perl, Apache, Stronghold, Unix
jhorner@knoxlug.org http://www.knoxlug.org/
  • 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 17:06 UTC
    um... Could you explain why I should care if merlyn gets touchy? Again, not to rant but.

    Just because he's virtually a perl God?....
    I don't buy that as a reason. It's a good reason to listen to him when he rants, but not a good reason for avoiding the exploration of ideas.

    Recursion is sometimes a useful programming tool. If we never use recursion just because of the danger of infinite loops and merlyn's touchiness, we will never learn how to effectively program recursions that aviod infinite loops.

    Finally merlyn has not appeared as touchy to me as he has to you. Full of advice, and willing to warn someone of the dangers of a particular approach, yes... touchy no.
    Quit to tout the benefits of prebuilt cross-platform-friendly modules, yes... Touchy no.
    So, how about a little room to flex our brains and try out that recursive loop every once in a while... We know where our CTRL+ALT+Delete keys and our power buttons are.

      To save everyone else the trouble of telling you, here is a link to the response that launched a thousand rants: Here

      J. J. Horner
      Linux, Perl, Apache, Stronghold, Unix
      jhorner@knoxlug.org http://www.knoxlug.org/
      
        Maybe I, The Cause Of The Thousand Rants, can have a word in this. ;-)
        I've benchmarked File::Find and the recursive opendir stunt and my conclusions are theese:
        Use File::Find on Unix, It's much faster than other methods there. In the sub, put /\.mp3$/ before -f (because that's faster!).
        On Win32 the recursive opendir method is faster, or at least as fast if you want to match /\.mp3$/.
        BUT DON'T FORGET TO CHECK FOR SYMBOLIC LINKS ON *NIX if you choose to do recursive opendir there...

        /brother t0mas