in reply to Re^3: Number of times I've used goto in Perl
in thread Number of times I've used goto in Perl
That doesn't contradict my point, which was that goto has 3 effects: transmitting @_ directly, removing the current function from the call stack and clearing the effect of local. If all you want to do is jump to another function without touching @_, this can be done like this:
I have quoted the relevant documentation in my previous post.sub oldFunctionName { &newFunctionName; }
Besides, since goto does this extra work, I wouldn't be confident about saying that it uses less CPU. Also perl does plenty of things under the hood, and the documentation calls it "magic". I would never conclude that a feature takes less CPU time based on the description of what it does alone.
There is no dereferencing in your code though, dereferencing would like one of those lines:
Sadly the syntax for a method call works only on (some) references, and also uses the arrow operator ( -> ) so it's quite confusing.$$self; ${$self}; @{$self}; %{$self}; $self->{Key}; $self->[0];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Number of times I've used goto in Perl
by HugoNo1 (Novice) on Oct 03, 2018 at 09:54 UTC | |
by Eily (Monsignor) on Oct 03, 2018 at 10:02 UTC |