#prototyped to explicitly state acceptable arguments sub addstuff($$$); ... #gives error if too few or too many arguments #(or arguements of wrong type)
OTOH:
>perl -wMstrict -le "my @ra = (99 .. 199); ;; sub S ($$$) { my $A = shift; my $B = shift; my $C = shift; ;; return $A + $B + $C; } ;; print S 1, 2, @ra; " 104
Maybe better read Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen first, then generally avoid prototypes.
In reply to Re^2: sub argument passing? (TIMTOWTDI)
by AnomalousMonk
in thread sub argument passing? (TIMTOWTDI)
by temporal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |