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

How can I get rid of the below warning,am using file::find and file::find::rule in the same module

use File::Find::Rule; use File::Find; Subroutine find redefined at /PerlApp/Exporter.pm line 57. Exporter::import('find', 'finddepth') called at perl.pl line 2 +6 main::BEGIN() called at perl.pl line 26 eval {...} called at perl.pl line 26
  • Comment on Using file::find and file::find::rule inthe same perl script is giving a warning
  • Download Code

Replies are listed 'Best First'.
Re: Using file::find and file::find::rule inthe same perl script is giving a warning
by ikegami (Patriarch) on Jun 28, 2011 at 19:19 UTC

    I don't know about file::find and file::find::rule, but both File::Find, File::Find::Rule export find by default.

    You can simply avoid importing find from one or both of the modules (e.g. use File::Find::Rule ();), using the fully qualified name for the function if necessary (e.g. File::Find::find(...);)