All:
I'm having problems trying to get Perl function prototype checking
working correctly.
My code looks something like:
main.pl:
use a;
a.pm:
use b;
use c;
b.pm:
sub b_function ($$$) {
}
c.pm:
use d;
d.pm:
b_function($p1);
I'm expecting to get a compilation error for the subroutine call in
d.pm, since it calls "b_function" with a single scalar as a parameter,
instead of the required 3 scalars as parameters.
A trivial test case that looks like:
main.pl:
sub a ($$$) {
}
a($x);
fails as expected with a compilation failure on the wrong number of
parameters passed to "a", but my application that looks like the above
code (although it's much bigger!) does not cause a compilation failure
when the wrong number of parameters are passed.
My .pm files only contain subroutine definitions, they have no package
statements. The lack of a package statement doesn't appear to change the
problem, however for simple cases I've constructed using a set of "use"
statements.
My Perl version info is:
$ perl -v
This is perl, v5.8.7 built for cygwin-thread-multi-64int
Copyright 1987-2005, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to
the
Internet, point your browser at http://www.perl.org/, the Perl Home
Page.
I'm running Perl under Cygwin on Windows XP.
Regards,
Gavin Bowlby