in reply to Re^3: Tutorial on File::Find even more basic than "Beginners Guide"
in thread Tutorial on File::Find even more basic than "Beginners Guide"

Joost:

and another "thank you" goes up, irritating those who regard such as space wasters.

so I guess I'll also have to seek one additional clarification: in line 11, re file::find, you write:

find \&process_file, "/some/directory";

As I understand this (and I think much more clearly, thank you!) I really need to specify all the subdirs, perhaps by stuffing them into an array and feeding each element to the sub?

  • Comment on Re^4: Tutorial on File::Find even more basic than "Beginners Guide"
  • Download Code

Replies are listed 'Best First'.
Re^5: Tutorial on File::Find even more basic than "Beginners Guide"
by Joost (Canon) on Jan 20, 2005 at 23:39 UTC
    You do not have to specify the subdirs of "/some/directory" - File::Find will walk through all the files and subdirs of "/some/directory" recursively. You may want to specify more directories if you want to call the same routine on a number of different directory trees:

    find \&process_file, "/cdrom", "/floppy";
    Will call process_file for each dir and file on the cdrom or floppy drive (well, it will on my machine, but the location of those drives in your filesystem might be different)