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,-path_info=>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

In reply to CGI Module behavior changes between Perl 5.8.1 and 5.8.8? by jsignal

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.