perlquestion
h2
<p>I'm clearly missing something here. All examples run with use strict/warnings</p>
<p>If I load File::Find with: </p>
<code>use strict;
use warnings;
use File::Find;</code>
<p>the following error goes away:</p>
<code>Name "File::Find::prune" used only once: possible typo at... </code>
<p>But if I use:</p>
<code>Require File::Find;
File::Find->import(qw(find));</code>
<p>the error appears. I am confused by this. Due to a decision by fedora/redhat to remove File::Find from core modules, the Require loading is required, not my choice unfortunately.</p>
<p>In &wanted, I'm trying to prune a directory, following examples and explanations from for example <a href="https://www.perlmonks.org/?node_id=63196">here</a> and in particular <a href="https://www.perlmonks.org/?node_id=676958">here</a>.</p>
This is a simplified example, but shouldn't matter since it's the single occurrence of $File::Find::prune = 1 that is making Perl complain.
<code>sub wanted {
if ($File::Find::name =~ m%^/path/detection%){
$File::Find::prune = 1;
return;
}
}</code>