Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

RE: My favorite looping mechanism in Perl is:

by merlyn (Sage)
on May 09, 2000 at 16:59 UTC ( #10748=note: print w/replies, xml ) Need Help??

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:
{ blah; blah blah; last if $some_condition; more blah; more blah blah; redo if $some_other_condition; }
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!

-- 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
    This is not an original observation, but you are one sick man. ;-)

    Thanks, Randal, for the insights you have shared in actually USING perl over the years.

    We appreciate it greatly.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://10748]
[erix]: humming bug
[choroba]: What's the name of a bug that manifests only in the production environment?
[shmem]: schrödinbug afaik, or a variant thereof
[shmem]: ah no, the higgs-bugson
[choroba]: not exactly, higgs must be predicted, but the one I'm dealing with was unexpected

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2018-02-20 13:44 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (271 votes). Check out past polls.