in reply to Re: file (mp3) list shown on website as links
in thread file (mp3) list shown on website as links

Actually, I've tried using File::Find at first, however, I'm a newbie to perl, and despite using many resources ranging from help from monks, perldoc, and Sams books (Yes, I know, I'll buy the Camel 3rd edition soon...), I just didn't understand how to use it. Thanks, your way is obviously superior. I'll vote ++ on it when I get my votes back (done for the day. :) ) -Nimster Freelance writer for GameSpy industries LTD. (www.gamespy.com)
  • Comment on Re: Re: file (mp3) list shown on website as links

Replies are listed 'Best First'.
Re: Re: Re: file (mp3) list shown on website as links
by ichimunki (Priest) on Dec 24, 2000 at 02:13 UTC
    The Camel (3rd) is usually great. Perldoc is usually quite informative. But in the case of File::Find, they are both sorely lacking. There isn't much to File::Find, and even that is sparsely explained in every source I checked. I had to do a lot of learning myself to get that script together-- I'd never used the module before either.
      The docs for File::Find are ludicrously bad. The first example you ever see is:
      sub wanted { /^\.nfs.*$/ && (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && int(-M _) > 7 && unlink($_) || ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) && $dev < 0 && ($File::Find::prune = 1); }
      However, if you look right at the bottom, you'll see a snippet like:
      sub wanted { -l && !-e && print "bogus link: $File::Find::name\n"; }
      which is really what you want to copy...

      Tony

        I don't want to copy anything. I want to write original code that I understand. :)

        Can you explain what that last snippet does that we can take advantage of in this situation?