in reply to Re: reading file names to an array from the directory tree
in thread reading file names to an array from the directory tree

I also want to have paths to this file starting from an indicated directory so that I can use open file command.
  • Comment on Re^2: reading file names to an array from the directory tree

Replies are listed 'Best First'.
Re^3: reading file names to an array from the directory tree
by ikegami (Patriarch) on May 22, 2010 at 23:43 UTC
    Obviously. The answer doesn't change.
Re^3: reading file names to an array from the directory tree
by vit (Friar) on May 22, 2010 at 23:58 UTC
    No need to answer, I got it. File::Find::Rule works perfectly ! Thanks !
      One stupid question. in() and name() are subs in the package. What is file() there?
      use File::Find::Rule; # find all the subdirectories of a given directory my @subdirs = File::Find::Rule->directory->in( $directory ); # find all the .pm files in @INC my @files = File::Find::Rule->file() ->name( '*.pm' ) ->in( @INC );
        file, name and in are all three class methods and object methods. file filters out results that fail a -f test.