finds the statement labeled with
and resumes execution there. It may not be used to go into any
construct that requires initialization, such as a subroutine or a
loop. It also can't be used to go into a construct that is
optimized away. It can be used to go almost anywhere else within the
including out of subroutines, but for that purpose it's
usually better to use some other construct such as
The author of Perl
has never felt the need to use this form of
(in Perl, that is - C
is another matter).
Going to even greater heights of orthogonality (and depths of idiocy),
, which expects
to evaluate to a label name, whose scope is
to be unresolvable
until run-time since the label is unknown when the statement is compiled.
This allows for computed gotos per FORTRAN, but isn't necessarily
if you're optimizing for maintainability:
goto +("FOO", "BAR", "GLARCH")[$i];
is highly magical, substituting a
call to the named subroutine for the currently running subroutine.
This is used by
subroutines that wish to load another
subroutine and then pretend that this subroutine - and not the original
one - had been called
in the first place (except that any modifications to
original subroutine are propagated to the replacement subroutine). After the
, not even
will be able to tell that the original
routine was called first.