On Feb 19, 2004, at 9:22 PM, R. Joseph Newton wrote:
I don't know, Rob. I would be interested in hearing of any real-world problem that
would demand this.
I believe the text book example is a language that lacks support for something like Java's "finally" block. A goto can guarantee you get to the code that must be executed, no matter the outcome of the current block.
James
One example of a legitimate use of goto from perlsub:
Many "AUTOLOAD" routines load in a definition for the requested subroutine using eval(), then execute that sub- routine using a special form of goto() that erases the stack frame of the "AUTOLOAD" routine without a trace. (See the source to the standard module documented in AutoLoader, for example.)
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>