in reply to Why $FIle::Find::prune = 1 returns used only once error
There is always no warnings 'once';. My personal preference is to use this locally to the error, so that you cam still detect inadvertent cases of this elsewhere in your code.
sub wanted { if ($File::Find::name =~ m%^/path/detection%){ no warnings 'once'; $File::Find::prune = 1; return; } }
Don't worry about adding execution time to your subroutine; this pragma is applied at compile time.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why $FIle::Find::prune = 1 returns used only once error
by ikegami (Patriarch) on Apr 19, 2021 at 21:08 UTC | |
|
Re^2: Why $FIle::Find::prune = 1 returns used only once error
by h2 (Beadle) on Apr 18, 2021 at 19:43 UTC |