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

Re: [FWP] A major screw-up: infinite loop



>>>>> "Bernie" == Bernie Cosell <bernie@fantasyfarm.com> writes:

Bernie> Elegance is in the eye of the beholder, I guess, but does anyone know any 
Bernie> benchmarks/rulesofthumb for the relative efficiencies of the two?  I'd 
Bernie> think that the increment/test version would be faster than the build-a-
Bernie> huge-list version, at least if you had a lot of values to iterate over.

Not in fairly recent versions of Perl -- a foreach loop iterating over
a dotdot list creates the items on the fly.  No longer a big list in
memory.

"Iterate at will!"[1]

[1] A bad parody of that awful movie that used the phrase "Intestinate
    at will!", in which I nearly felt the same pain in my seat as the
    on-screen characters, except from an entirely different source.

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