XP is just a number | |
PerlMonks |
Re^3: Contents of @_ using subroutine signatures with default values (flag)by dave_the_m (Monsignor) |
on Jul 14, 2020 at 09:44 UTC ( [id://11119289]=note: print w/replies, xml ) | Need Help?? |
The simplified answer: no, it's not that simple. If @_ isn't populated, then the signature code gets its arguments directly from the stack.
If @_ gets populated, then the stack and @_ can get out of sync, e.g. by code within the signature which manipulates @_. So in that case the code must get its args from @_ rather than from the stack. So there have to be two code paths for everything.
See this p5p post for more details. Dave.
In Section
Seekers of Perl Wisdom
|
|