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

Re: [FWP] From "The Art of Perl", Ch. 1



>>>>> "Eli" == Eli Evans <eevans@libronix.com> writes:

Eli> Jeff Pinyan [mailto:jeffp@crusoe.net] says:
Eli> : Operating on Lists
Eli> : ------------------
Eli> : 
Eli> : array-to-hash
Eli> : 
Eli> : 	while (($k,$v) = each %{{ @list }}){ ... }

Eli> Dare I say it? This particular idiom causes an endless loop when I use it
Eli> (latest ActivePerl build (519): 5.005_03 built for MSWin32-x86-object). 

Eli> Looks like the 'each' iterator isn't incremented when you use %{{@list}}:

It can't be.  It rebuilds the hash on each iteration!

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <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!

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