Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: If I was forced to use only one kind of loop for the rest of my days it would be a

by saskaqueer (Friar)
on Oct 08, 2005 at 15:51 UTC ( [id://498423]=note: print w/replies, xml ) Need Help??


in reply to If I was forced to use only one kind of loop for the rest of my days it would be a

I missed the 'triple nested labeled goto spaghetti loop' and wound up voting for the simply uninteresting 'labeled block'. My reasoning behind wanting the triple nested goto block is simple enough: if I'm going to be using the construct for the short eternity of my life, I'd better enjoy using it. Just reming yourself that you are going to drive yourself crazy using one looping mechanism, so you'd might as well choose the crazy one.

# why code this (equiv: print $_, "\n" for 1 .. 10;) for my $i (1 .. 10) { print $i, "\n"; } # when you can code this? -- untested, no perl # on current box; probably doesn't do what # the above snippet does, but it's suppose to my $i = 0; ONE: { $i -= (8 - 2 * 2 - 2 * 4); # $i += 4 goto FOUR; TWO: { print $i; THREE: { print "\n"; 10 == $i ? exit() : goto ONE; FOUR: { $i += 3 * -1; # $i -= 3; goto TWO; } } } }
  • Comment on Re: If I was forced to use only one kind of loop for the rest of my days it would be a
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://498423]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2024-04-16 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found