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

Re: [FWP] awww, no fun :(



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).  

You shouldn't be able to use loop control functions (last, redo,
etc...) outside a loop's lexical context.  Action at a distance at its
finest.

So I'd say tied variables are doing the *right* thing (although
probably for the wrong reasons) and tied($foo)->STORE($foo + 1); is
doing the wrong thing.

-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <perl-qa@perl.org>	     Kwalitee Is Job One
Sometimes these hairstyles are exaggerated beyond the laws of physics
	  - Unknown narrator speaking about Anime

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