http://qs321.pair.com?node_id=182025


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