in reply to My favorite looping mechanism in Perl is:
My favorite construct is the naked block, together with redo and last to trigger restart and exit:
There... we've got a middle-exiting loop, guaranteeing at least one execution of the first part. Who says we don't have an easy "do-while" loop!{ blah; blah blah; last if $some_condition; more blah; more blah blah; redo if $some_other_condition; }
-- Randal L. Schwartz, Perl hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE: My favorite looping mechanism in Perl is:
by gaudior (Pilgrim) on May 09, 2000 at 19:39 UTC |
In Section
Past Polls