Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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


Comment on Re: GOTO considered (a necessary) evil?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2015-07-06 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (69 votes), past polls