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.
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|Replies are listed 'Best First'.|
Re^3: Contents of @_ using subroutine signatures with default values (flag)
by dave_the_m (Monsignor) on Jul 14, 2020 at 09:44 UTC
by LanX (Sage) on Jul 14, 2020 at 10:21 UTC