I think there is no need to use 'next' in wanted subroutine.
Can you try this:
sub wanted {
# if ($_ !~ /txt/) {
# next;
# }
# next unless ($_ =~ /html/); # Original line.
if (/html/ && -f $File::Find::name) {
push(@dirs_to_delete,$File::Find::name);
}
} # End of wanted
Beginner <[EMAIL PROTECTED]> wrote:
Hi,
Error message:
"Exiting subroutine via next at mk-thumbs.pl line 188"
I have a script that uses File::Find.
...snip
use strict;
use warnings;
use File::Basename;
use File::Find;
...snip
find(\&wanted, @dirs_to_search);
In the callback for find I have this:
sub wanted {
if ($_ !~ /html/) {
next;
}
# next unless ($_ =~ /html/); # Original line.
if (-f $File::Find::name) {
push(@dirs_to_delete,$File::Find::name);
}
} # End of wanted
When it's run I get hundreds of lines to STDERR that the call back is
exiting via next. Not a biggy but as the script is run from cron I
don't want to pour through hundreds of useless lines to see if there
are any legitimate errors.
Is there a way to suppress such errors? Does the warning come from
the warnings pragma? If so it looks configurable, can I restrict is
to just FATAL errors, if so any example would be appreciated.
Thanx.
Dp.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Ashish Srivastava
http://www.ashudotnet.blogspot.com/
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers