Re: Possible error in Event::Watcher::configure?

[email protected] (Graham Barr)
Newsgroups perl.loop
Message-ID <[email protected]>
On Tue, Jul 17, 2001 at 11:37:28AM -0400, Uri Guttman wrote:
> >>>>> "JB" == Jeff Boes <[email protected]> writes:
> 
>   JB>   while (my ($k,$v)= splice @_, -2) { $o->$k($v)}
> 
>   JB> is a bug that should read
> 
>   JB>   while (@_ and my ($k,$v)= splice @_, -2) { $o->$k($v)}
> 
>   JB> at least, under perl 5.6.1.
> 
> why do you say that? returning an empty list is a normal way of exiting
> a loop. each in a list context does it and the boolean code expects to
> look for it. there are times when you can't check the original list (it
> could be an iterator like each) so the empty list is the out of band EOF
> value.

Heh, I was going to reply with the same answer, until I realized the problem
was not the assignment, but the -2. Try

  perl -we '@a = splice @b, -2'

Graham.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.