in reply to Re: why does location of function matter?
in thread why does location of function matter?

##########################
sub PostValidate() {
##########################
my ($file) = @_;
my $cmd = "wc -l $file";
{more stuff}
  • Comment on Re^2: why does location of function matter?

Replies are listed 'Best First'.
Re^3: why does location of function matter?
by davido (Cardinal) on Jun 01, 2015 at 23:02 UTC

    That should be written as:

    sub PostValidate { ... }

    As you have it declared, sub PostValidate does declare a prototype. An empty prototype means no args may be passed (assuming Perl sees the subroutine is declared before its first use, as you've discovered).


    Dave

Re^3: why does location of function matter?
by Anonymous Monk on Jun 01, 2015 at 22:47 UTC

    I don't have any prototypes defined

    sub PostValidate() {

    An empty prototype () is still a prototype.

    You should always Use strict and warnings.