You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ulrich Windl <Ul...@rz.uni-regensburg.de> on 2001/02/28 10:53:01 UTC
mod_perl-1.24: ...called too early to check prototype...
Hello,
I have a non-trivial CGI script that ran fine with an older Perl and
mod_perl, even with -w ans use strict. Recently I upgraded to Perl-5.6
and mod_perl-1.24, and I get this new warning in Apache:
[Tue Feb 27 15:52:15 2001] bugCGI.pl: main::validate_token() called too
early to check prototype at /usr/local/httpd/cgi-bin/bugCGI.pl line
1454.
The routine in question is not called before declaration. The spot in
question is a recursive call however.
Sketch of the code:
# validate current token @@@line 1339
sub validate_token($)
{
my $q = shift;
...
} else { # invalid token
$q->delete($tokenname);
validate_token($q); # get a new token @@@trouble line
}
}
Am I right that this is not a programming error on my side?
Regards,
Ulrich
Re: mod_perl-1.24: ...called too early to check prototype...
Posted by Paul Johnson <pa...@pjcj.net>.
On Wed, Feb 28, 2001 at 10:53:01AM +0100, Ulrich Windl wrote:
> Hello,
>
> I have a non-trivial CGI script that ran fine with an older Perl and
> mod_perl, even with -w ans use strict. Recently I upgraded to Perl-5.6
> and mod_perl-1.24, and I get this new warning in Apache:
>
> [Tue Feb 27 15:52:15 2001] bugCGI.pl: main::validate_token() called too
> early to check prototype at /usr/local/httpd/cgi-bin/bugCGI.pl line
> 1454.
sub validate_token($);
> # validate current token @@@line 1339
> sub validate_token($)
> {
> my $q = shift;
> ...
> } else { # invalid token
> $q->delete($tokenname);
> validate_token($q); # get a new token @@@trouble line
> }
> }
>
>
> Am I right that this is not a programming error on my side?
Probably. Either provide a forward declaration of the sub, or don't use
a prototype.
--
Paul Johnson - paul@pjcj.net
http://www.pjcj.net