in reply to Re: Re: stderr output
in thread stderr output

next is for loop control while return is for returning from a subroutine. Witness the different behaviour in this (demonstration only) code:
mysub(5); sub mysub { my $val = shift || 8; print "next demo: \n"; for (1..10){ next if $_ == $val; print $_, "\n"; } print "\nreturn demo: \n"; for (1..10){ return if $_ == $val; print $_, "\n"; } }

--
Until you've lost your reputation, you never realize what a burden it was or what freedom really is. -Margaret Mitchell

Replies are listed 'Best First'.
Re: Re: Re: Re: stderr output
by Anonymous Monk on Sep 10, 2002 at 10:59 UTC
    Thanks for the detailed explanation! Now I understand.