[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] awww, no fun :(



On Apr 12, Michael G Schwern said:

>On Thu, Apr 12, 2001 at 01:20:35PM -0400, Jeff Pinyan wrote:
>> I get told that I can't call last().  That's upsetting.  Does anyone know
>> how to emulate the effect, other than change $foo++ to
>> 
>>   tied($foo)->STORE($foo + 1);
>> 
>> (which works, by the way).
>
>I'm more than a little distrubed by this.  Consider...
>
>  perl -wle 'sub foo { last; } while(1) { foo() }'
>
>In any sane universe, that loop would never exit.  In perl's, it exits
>on the first iteration (with a warning).  

Except that this functionality was explicitly added to Perl, around 5.005
I believe.

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter.         Brother #734


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe