Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2016-12-05 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (75 votes). Check out past polls.