The magic goto really introduces a bit more (or another) overhead, in that it looks back and forth, saves @_, carefully disassembles the current stack frame and replaces it with the one of the called sub, and then restores @_. The magic goto is most useful to replace the current subroutine, mainly to eliminate AUTOLOAD from what caller() might report. So in replacing &z with goto &z we are trading localizing @_ against disassembly of a whole sub frame. I don't know what's "cheaper".
&z is really a shorthand of z(@_) which additionally overrides the argument prototypes of sub z (if any).
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re^3: map vs for (not the usual breed)
by shmem
in thread map vs for (not the usual breed)
by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |