http://qs321.pair.com?node_id=11119287


in reply to Re: Contents of @_ using subroutine signatures with default values
in thread Contents of @_ using subroutine signatures with default values

> @_ 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
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery