PugSA has asked for the wisdom of the Perl Monks concerning the following question:

Hi fellow monks I need to loop through a directory tree and open each file to check if there is a certain tag in it does anybody have a piece of code that can help me loop through the tree structure, please. This is in windows Regards

Replies are listed 'Best First'.
Re: Directory tree in window
by davorg (Chancellor) on Jun 30, 2005 at 14:42 UTC

    You need the File::Find module. It's a standard part of Perl.

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

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: Directory tree in window
by holli (Abbot) on Jun 30, 2005 at 14:43 UTC
    perldoc -f glob

    or

    perldoc -f opendir
    perldoc -f readdir


    holli, /regexed monk/
      Thank you guys
Re: Directory tree in window
by shiza (Hermit) on Jun 30, 2005 at 14:58 UTC
    IO::Dir would be useful as well, especially if you want an object oriented interface to your directories. It is part of the Perl distribution too.