Randal L. Schwartz wrote:
> 
> Yes, I'd be in favor of making return() in a valued block (as opposed
> to a looping block) abort the block early and return the value.  

Imho, it should return the value, but not abort the block.  That's
not very dwimmy.  Loop blocks look like sub blocks to me.  After all,
grep is (ostensibly) prototyped as grep(&@), so I expect to pass it
a sub block.  And that block gets called once per iteration over the
input list; "return" is what I expect it to do once per iteration,
implicitly; so using C<return> explicitly to mean "no further iterations"
is highly counterintuitive, or at least inconsistent.

-- 
John Porter

        We're building the house of the future together.

Reply via email to