Is there no way to say that f2 expects 2 scalars, but should accept an array of arguments just like any other Perl function?sub f1 { return $_[0] + $_[1] } sub f2 ($$) { return $_[0] + $_[1] } my @a = (1, 2); print f1 (@a) . "\n" #print f2 (@a) . "\n" # compile-time error with f2
In reply to passing array of args to prototyped subs by pldanutz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |