goto
Perl supports a goto command. There are three forms:
goto
label, goto expr,
and goto & name.
In general, you shouldn’t need to use goto, which you’ll conclude if you do a
search for goto in the
comp.lang.perl.misc archives on http://www.dejanews.com.
The goto
label form finds the statement labeled
with label and resumes execution there.
It may not be used to go inside any construct that requires
initialization, such as a subroutine or a foreach loop.
The goto
expr form expects the expression to
return a label name.
The goto &
name form substitutes a call to the
named subroutine for the currently running subroutine.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access