Subject: | url() method's behavoir changes during upgrade. |
I'm having a difficult time after upgrading from Perl 5.8.1 to 5.8.8.
I support an application that creates a CGI object, calls the
CGI::path_info($new_pathinfo) method with a parameter to set the
variable in the object, and then spits out a URL by calling
CGI->url(-relative=>0,-query=>1,-pathinfo=>1).
This simple script exhibits the differing output between the versions of
the Perl interpreter:
The Code:
#!/usr/bin/perl
use CGI;
my $cgi = new CGI;
print $cgi->header();
print("Created CGI.<br>\n");
printCgi($cgi);
$cgi->path_info("/pathinfo1");
print("Set path_info to \"/pathinfo1\".<br>\n");
printCgi($cgi);
sub printCgi(){
my $cg = shift;
print("***********************************************************
+*******<br>\n");
print(" URL: ".$cg->url(-path_info=>1,-relative=>0,-query=>
+1)."<br>\n");
print("path_info(): ".$cg->path_info()."<br>\n");
print("***********************************************************
+*******<br>\n");
}
The Output:
When I browse to http://servername/cgi-bin/cgitest.cgi/AAAA on a server
with Perl 5.8.1, I get this output:
Created CGI.
******************************************************************
URL: http://servername/cgi-bin/cgitest.cgi/AAAA
path_info(): /AAAA
******************************************************************
Set path_info to "/pathinfo1".
******************************************************************
URL: http://servername/cgi-bin/cgitest.cgi/pathinfo1
path_info(): /pathinfo1
******************************************************************
If I browse to the EXACT SAME SCRIPT on a server running Perl 5.8.8, I
get this output:
Created CGI.
******************************************************************
URL: http://servername/cgi-bin/cgitest.cgi/AAAA
path_info(): /AAAA
******************************************************************
Set path_info to "/pathinfo1".
******************************************************************
URL: http://servername/cgi-bin/cgitest.cgi/AAAA/pathinfo1
path_info(): /pathinfo1
******************************************************************
This change in the behavior of the CGI module is causing me big
headaches. If anyone has suggestions, please let me know!
Thanks,
Jason
Comment on