In Perl, is it better to use goto
or local function, and why with an example?
For example, I am using a code
sub data {
data;
}
data();
or
goto L:
L: if ( $i == 0 )
print "Hello!!!!";
Programmers don't die. They just
GOSUB
withoutRETURN
.
That said, do not use goto
in Perl.
goto
There is one place where a goto
makes sense in Perl. Matt Trout is talking about that in his blog post No, not that goto
, the other goto
.