Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Perl style question: loops with postcondition

by kodo (Hermit)
on Jun 28, 2002 at 06:48 UTC ( [id://177986]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Perl style question: loops with postcondition

For me Nr.1 (
do { ... } while($condition)
is the most (logical | easy to read) one. But I also like Nr.2
I don't like Nr.3 because I learned that goto: "It scans outward from your current location for the indicated label." (by larry wall) which decreases performance and just look weird (remembers me on basic and dos-batches...) to me...

giant

Replies are listed 'Best First'.
Re: Re: Perl style question: loops with postcondition
by RMGir (Prior) on Jun 28, 2002 at 08:19 UTC
    giant said:

    I don't like Nr.3 because I learned that goto: "It scans outward from your current location for the indicated label." (by larry wall) which decreases performance and just look weird (remembers me on basic and dos-batches...) to me...

    I'll give you the basic and dos parts, but I'm fairly sure that "scans outward" would only apply if you're using the goto EXPR form, rather than a goto LABEL where the label is explicit.

    For the goto LABEL form, the location of LABEL has to be resolved at compile time, so it's probably not very costly.

    Check out Programming Perl, 3rd Edition, page 126.
    --
    Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://177986]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.