in reply to Re: Obtaining a list of files in a directory and subdirectory.
in thread Obtaining a list of files in a directory and subdirectory.

Thanks guys. I think i will go with the file::find::rule. However, when i try and do a simple search on a directory, i get the follwoing error: Subroutine main::find redefined at C:/Perl/site/lib/File/Find/Rule.pm line 21. Any ideas. The code is pretty simple:
my @files = File::Find::Rule->file()->in( "c:/" );

Replies are listed 'Best First'.
Re^3: Obtaining a list of files in a directory and subdirectory.
by kennethk (Abbot) on Oct 16, 2009 at 14:59 UTC
    That warning (not an error) is thrown when you overwrite an existing subroutine, in this case you have two subroutines in your main package called "find". The File::Find::Rule module exports a subroutine named "find", so I'm guessing you've defined one as well in your code.
      Ahh ok. Thanks. Would i still use file::find even if I just want to find a directory? Or is there a different module i need to use like directory::find?