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

Re: GOTO considered (a necessary) evil?

by Abigail-II (Bishop)
on Jul 16, 2002 at 09:25 UTC ( #182025=note: print w/replies, xml ) Need Help??


in reply to Re: Re: GOTO considered (a necessary) evil?
in thread GOTO considered (a necessary) evil?

This typo generates an error...
perl -le 'BAR: print 1; BAZ: for (2..3) {print; redo BAR; }'
This typo causes an infinite loop...
perl -le 'BAR: print 1; BAZ: for (2..3) {print; goto BAR; }'
That's a pretty weak example, because if you omit the typos, both
perl -le 'BAR: print 1; BAZ: for (2..3) {print; redo BAZ; }'
and
perl -le 'BAR: print 1; BAZ: for (2..3) {print; goto BAZ; }'
behave identically - looping infinitely.

Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://182025]
help
Chatterbox?
[LanX]: damn my headphones were not plugged and the video blasted thru the office ...
[LanX]: xD
[LanX]: .. my boos woke up... ;-)
[Eily]: nice to see I'm not the only one looking like a fool at work
Eily answered a message but made the smiley on his face instead of in the message

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2017-09-20 15:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (237 votes). Check out past polls.

    Notices?