Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 ( #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
Node Status?
node history
Node Type: note [id://498423]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2019-03-22 02:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (110 votes). Check out past polls.

    Notices?