[vox-tech] subroutine arguments with PERL
Brian Lavender
brian at brie.com
Tue Nov 30 10:59:32 PST 2010
How do you tell perl to warn or not compile if you are not using
the correct number of arguments in a subroutine?
sub foo() {
my ($stat_ref, $record_number, $prev_line, $line, $line_number) = @_;
# do stuff
}
# say in my call, I put the wrong number of arguments.
&foo($stat_ref, $record_number, $prev_line, $line, $line_number);
brian
--
Brian Lavender
http://www.brie.com/brian/
"Program testing can be used to show the presence of bugs, but never to
show their absence!"
Professor Edsger Dijkstra
1972 Turing award recipient
More information about the vox-tech
mailing list