>>>>> "Chaim" == Chaim Frenkel <[EMAIL PROTECTED]> writes:

>>>>> "CF" == Chaim Frenkel <[EMAIL PROTECTED]> writes:
CF> (Kirrily, this one is for the record.)

CF> I'd also like to add, redo, next, last escaping a subroutine.

Chaim> Make that _NOT_ escaping a subroutine.


Chaim>  map { ...; last; ...} @foo

Chaim> should simply terminate the map, not go to the next containing loop.

So using map as it SHOULD be used (heh), what would you have @a
contain after:

        @a = map { last if $_ > 5; $_ } 1..10;

Would it be 1..5, 1..6, 1..10, whatever it had before, or ()?  I could
make arguments for each of them. :)

I think making that *not* a looping block makes more sense, so we
don't get into this nonsense.  The "last" cleanly breaks out of the
innermost loopblock, which by definition doesn't have a return value,
so there's no chance we'll freak out an assignment.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to