Google News
logo
Perl - Interview Questions
What is goto statement in Perl?
The Perl goto statement is the jump statement. It transfers control by jumping to another label inside a loop.
 
There are three goto forms :

Goto LABEL : at this label, execution stops at the current point and resumes at the point where the label is specified. You cannot jump to a point inside a subroutine using Goto Label.

Goto NAME : it replaces the subroutine that is currently executing with a call to a particular subroutine instead. It automatically calls a different subroutine dynamically selects alternative routines.

Goto EXPR : it is an extension of Goto label.
Advertisement