Re: buglet in File::Listing - s/next/return/

Gisle Aas (gisle@aas.no)
11 Mar 1998 12:58:30 +0100


erik@mediator.uni-c.dk writes:

> I have a cronjob that checks a few ftp archives for new files
> from time to time. To do this, I utilise File::Listing, currently
> from libwww-5.20.
> 
> For one of the ftp servers, I get the following warning each time
> this script is run:
> 
> Exiting subroutine via next at /usr/local/lib/perl5/site_perl/File/Listing.pm line 221.
> 
> By looking at Listing.pm, it seems that while ripping some code out from
> a loop and placing it in a function by itself, one of the next statements
> is still present, but should probably be a return as shown in the patch
> below:

Looks good.  This patch will be in the next release.

Regards,
Gisle


> 
> *** Listing.pm.orig     Wed Mar 11 09:20:53 1998
> --- Listing.pm  Wed Mar 11 09:21:31 1998
> ***************
> *** 218,224 ****
>   
>       } elsif (/^(.+):$/ && !/^[dcbsp].*\s.*\s.*:$/ ) {
>         my $dir = $1;
> !       next if $dir eq '.';
>         $curdir = $dir;
>         return ();
>       } elsif (/^[Tt]otal\s+(\d+)$/ || /^\s*$/) {
> --- 218,224 ----
>   
>       } elsif (/^(.+):$/ && !/^[dcbsp].*\s.*\s.*:$/ ) {
>         my $dir = $1;
> !       return () if $dir eq '.';
>         $curdir = $dir;
>         return ();
>       } elsif (/^[Tt]otal\s+(\d+)$/ || /^\s*$/) {