3 ms·
The claim is that you must execute a Perl 5 subroutine to discover its arity. That's nonsense. In the general case, Perl 5 subroutines have well-defined ariti
by chromatic 17y ago
The claim is that you must execute a Perl 5 subroutine to discover its arity. That's nonsense.
In the general case, Perl 5 subroutines have well-defined arities: they consume as many arguments as possible, either delimited by parentheses or the statically-unambiguous end of an expression.
In the special case of prototyped subroutines, the parser knows their arities as soon as it encounters their declarations.
None of this has any connection to the claim that "it's necessary to execute the subroutine to discover just how many [tokens] it will consume." If that were true, perl -c would not work.