in reply to passing array of args to prototyped subs
You should really read perlsub. Perl prototypes do not work as you expect.
In Perl, you do not check for the correct number and count of arguments at compile time, but at run time. The minimal solution for exactly two arguments is:
sub f # *NO* prototype! { @_==2 or die "f needs two arguments"; # ... }
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing array of args to prototyped subs
by pldanutz (Acolyte) on Sep 10, 2013 at 05:35 UTC | |
by tobyink (Canon) on Sep 10, 2013 at 09:09 UTC |