in reply to RE: Number of times I've used goto in Perl
in thread Number of times I've used goto in Perl
As such goto is used in quite a few modules, core or otherwise. CGI.pm, for example.When Perl tries to call an undefined function in a particular package and that function is not defined, it looks for a function in that same package called AUTOLOAD. If one exists, it's called with the same arguments as the original function would have had. The fully-qualified name of the function is stored in that package's global variable $AUTOLOAD. Once called, the function can do anything it would like, including defining a new function by the right name, and then doing a really fancy kind of goto right to it, erasing itself from the call stack.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: Number of times I've used goto in Perl
by turnstep (Parson) on Apr 19, 2000 at 01:48 UTC | |
by btrott (Parson) on Apr 19, 2000 at 02:11 UTC | |
by turnstep (Parson) on Apr 19, 2000 at 02:51 UTC | |
by Anonymous Monk on Apr 20, 2000 at 22:21 UTC | |
|
Re^3: Number of times I've used goto in Perl
by ikegami (Patriarch) on May 06, 2018 at 08:07 UTC |