in reply to Re: File::Find exit
in thread File::Find exit

This is a runtime error in Perl 5.6.1 at least.
perl -e "sub x{last} x" Can't "last" outside a loop block at -e line 1.
Update: That was naive. See Bart's followup which corrects/expands this.

Replies are listed 'Best First'.
Re: Re: Re: File::Find exit
by bart (Canon) on Oct 29, 2003 at 19:01 UTC
    Eh... not always.
    #!/perl/bin/perl -wl sub x { last } for(1 .. 3) { print; x(); } print "done";
    Result:
    Exiting subroutine via last at test.pl line 2.
    1
    done
    
    Here, it's a warning, not a fatal error.