Subject: | uninitialized value with startform with non-apache webserver |
Date: | 31 Jan 2007 15:20:16 +1100 |
Date: | Wed, 31 Jan 2007 15:20:16 +1100 |
To: | bug-CGI.pm [...] rt.cpan.org |
From: | Callum Gibson <callumgibson [...] optusnet.com.au> |
startform calls request_uri() which returns $ENV{REQUEST_URI} which is
an Apache-specific environment variable. This has been a recurring issue
since it was introduced and all code now seems to check if request_uri
is defined upon use, but calling $self->request_uri causes an
"uninitialized value" warning if you run your CGI under perl -w using
a non-Apache webserver.
Since undefined values of request_uri appear to be already handled,
modifying the subroutine request_uri to the following would seem to
be sufficient:
sub request_uri {
return $ENV{'REQUEST_URI'} if defined($ENV{REQUEST_URI});
return undef;
}
--
Callum Gibson @ home
http://members.optusnet.com.au/callumgibson/