in reply to Re^2: given-when last time through loop?
in thread given-when last time through loop?

I've now submitted this patch to the perl 5 porters, in the hope that it's a bit clearer:
diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod index d5fc4a7..4e1bc0a 100644 --- a/pod/perlsyn.pod +++ b/pod/perlsyn.pod @@ -679,7 +679,7 @@ string occurs in an array: } print "\@array contains $count copies of 'foo'\n"; -On exit from the C<when> block, there is an implicit C<next>. +At the end of all C<when> blocks, there is an implicit C<next>. You can override that with an explicit C<last> if you're only interested in the first match.

So far I've found the porters very cooperative when it comes to doc patches, and I want to encourage everybody to submit patches when they find something that can be improved in the docs.

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^4: given-when last time through loop?
by ikegami (Patriarch) on Nov 19, 2009 at 15:36 UTC
    That's wrong. It should be "At the end of every C<when> block"
Re^4: given-when last time through loop?
by 7stud (Deacon) on Nov 19, 2009 at 15:36 UTC

    Forgive me for criticizing, but I don't think that highlights the change that occurs. Now the docs will have two contradictory statements: one statement will say there are implicit breaks, and this new statement will say there are implicit nexts. I think some readers may get confused and believe that one of them is a typo. I think, something like the following would highlight that a change occurs from implict breaks to implicit nexts:

    Inside a for-loop, a when block ends with an implicit next rather than an implicit break.

      You're right. You should reply to my p5p mail with a better patch.
        I spent two hours over there trying to retrieve your message and failed. I won't ever being going back there again. Those newsgroups are too arcane and unusable as far as I'm concerned.