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

Dear Gurus, I'm trying to use File::Find module to recursively obtain list of files in a folder & its subfolders. However, upon installing the module via cpan, i keep getting below

cpan> force install File::Find Database was generated on Mon, 27 Nov 2017 23:08:45 GMT Warning: Cannot install File::Find, don't know what it is. Try the command i /File::Find/ to find objects with matching identifiers.

What could be wrong here? Any clue/inputs would be greatly appreciated.

Replies are listed 'Best First'.
Re: File::Find installation problem
by haukex (Archbishop) on Nov 28, 2017 at 09:25 UTC

    As others have pointed out, File::Find is a core module, meaning it is distributed with Perl itself and it doesn't normally need to be installed separately.

    Have you confirmed that you need to install the module in the first place? Try the command perl -MFile::Find -le "print -OK", which will either print "-OK" if the module is installed, or die with "Can't locate File/Find.pm in @INC (you may need to install the File::Find module)" if for some reason it is not.

    Some distros don't ship all of the core modules, for example hippo has written that is the case for CentOS and RHEL, and suggested to "install the cleverly-named perl-core RPM which is a meta package and pulls in all the core modules as dependencies."

    If you're not on one of those OSes and still have the problem, there may be a problem with your Perl installation. In that case try posting the full output of perl -V here inside <code> tags.

Re: File::Find installation problem (cpan client problem)
by Discipulus (Canon) on Nov 28, 2017 at 08:59 UTC
    Hello colox,

    sorry no guru here.. I firstly supposed you have some misconfiguration issue with cpan client ( anyway check it with cpan o conf ), but effectively this module seems to be strange from cpan client point of view:

    >cpan -D List::Util Loading internal null logger. Install Log::Log4perl for logging messag +es CPAN: CPAN::SQLite loaded ok (v0.211) Database was generated on Tue, 28 Nov 2017 08:46:33 GMT List::Util ---------------------------------------------------------------------- +--- (no description) P/PE/PEVANS/Scalar-List-Utils-1.49.tar.gz D:\ulisseDUE\perl5.26.64bit\perl\lib\List\Util.pm Installed: 1.48 CPAN: 1.49 Not up to date Paul Evans (PEVANS) leonerd@leonerd.org.uk >cpan -D File::Find Loading internal null logger. Install Log::Log4perl for logging messag +es CPAN: CPAN::SQLite loaded ok (v0.211) Database was generated on Tue, 28 Nov 2017 08:46:33 GMT

    Also cpan> i /File::Find/ show 67 packages but not File::Find and cpan> i File::Find shows No objects found of any type for argument File::Find

    Weird..

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: File::Find installation problem
by karlgoethebier (Abbot) on Nov 28, 2017 at 09:04 UTC
    "...File::Find module to recursively obtain list of files..."

    You might do yourself a favor and give Path::Iterator::Rule a try.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Re: File::Find installation problem
by Anonymous Monk on Nov 28, 2017 at 02:36 UTC

    What did i /File::Find/ return?

    One issue could be that F::F is not available by itself (any more?), but only as core module (installed with your perl).

      ... available ... as core module (installed with your perl).

      See corelist:

      c:\@Work\Perl\monks>corelist File::Find File::Find was first released with perl 5
      (The example above was run under Perl 5.8.9.)


      Give a man a fish:  <%-{-{-{-<