in reply to (bbfu) (prototype misconception) Re(2): Declaring Subroutines (predeclare, catch errs at compiletime?)
in thread Declaring Subroutines
% perl -le 'sub f ($) { print @_ } f(1, 2)' Too many arguments for main::f at -e line 1, at end of line Execution of -e aborted due to compilation errors. % perl -le 'sub f ($) { print @_ } f()' Not enough arguments for main::f at -e line 1, at end of line Execution of -e aborted due to compilation errors.
Prototypes have been catching errors of this sort since 5.002.
hdp.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 4: Declaring Subroutines (predeclare, catch errs at compiletime?)
by tilly (Archbishop) on Apr 25, 2001 at 17:52 UTC | |
|
(bbfu) (further prototype misconception) Re(4): Declaring Subroutines (predeclare, catch errs at compiletime?)
by bbfu (Curate) on Apr 25, 2001 at 06:59 UTC |