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

[email protected] (Uri Guttman)
Newsgroups perl.loop
Message-ID <[email protected].>
>>>>> "GB" == Graham Barr <[email protected]> writes:

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

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

yoicks! you got it there.

he seems to want to slice from the right edge.

whenever i do a destructive loop (which is rare), i check the array
itself like his corrected code. there are other safer ways to do
that. one would be to splice from the left side. i don't see any reason
to do it from the right side.

uri

-- 
Uri Guttman  ---------  [email protected]  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info:     http://www.sysarch.com/perl/OOP_class.html
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.