Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 19795
Status: rejected
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: jsignalness [...] btinet.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



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
On Thu Jun 08 15:59:13 2006, guest wrote: Show quoted text
> 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
Jason, Thea example above uses path_info() to set values, but this is publicly supported feature according to the documentation: http://search.cpan.org/~lds/CGI.pm-3.43/CGI.pm#FETCHING_ENVIRONMENT_VARIABLES Sometimes changes happens between versions to fix bug or address the rare security issue. If you depend on an exact behavior of CGI.pm or another module, I suggest keeping a private copy of a specific version with your application, so that it only changes when you want it to change, not just because Perl was upgraded. In the meantime, I'm rejecting this bug now due to any lack of further follow-up here since 2006. If you believe the current implementation of url() is still buggy, please reply to re-open this ticket. Mark