Perl Monk, Perl Meditation | |
PerlMonks |
Re^2: Contents of @_ using subroutine signatures with default values (flag)by LanX (Saint) |
on Jul 14, 2020 at 09:07 UTC ( [id://11119287]=note: print w/replies, xml ) | Need Help?? |
> @_ probably wont be populated within signatured subroutines This desire seems to originate from the performance impact of populating @_. But this will break some compatibility to older code and make migration harder. May I suggest a compromise to scan the functions body for the use of @_ and to dynamically decide then? Attaching a flag to the code-ref which is evaluated by the signature code once the parser encounters @_ shouldn't be too difficult. I hope you all have in mind that goto &sub relies on @_. So does the debugger via @DB:_ for call stack traces. As a side note: JS has a "arguments" array analog to @_ and performance is not JS' problem.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|