Operating System - HP-UX
1833792 Members
2509 Online
110063 Solutions
New Discussion

PERL 5.6: query params problem

 
Ciaran Byrne
Advisor

PERL 5.6: query params problem

Hi,
I am having an issue with Apache and/or PERL whereby in the URL '&' characters are being replaced with ';'. This is the HP version of Apache 1.3.19.23 on HP-UX 11i
and PERL 5.6.

A request like
http://hostname/cgi-bin/test.cgi?nameone=123&nametwo=1

after the PERL script (using the CGI pragma) parses the URL and redirects to a
landing page such as
http://hostname/redirectedpage?nameone=123;nametwo=1

however the & becomes a ';' and the page cannot be displayed. When the script is changed to use the PERL 5.005 version this works correctly. However from what I have read
so far the web server should be able to handle the ';'.

anybody any ideas?

Regards.
1 REPLY 1
Gregory Fruth
Esteemed Contributor

Re: PERL 5.6: query params problem

From the CGI.pm documentation, there appears
to have been a change in the CGI spec at some
point.

>> -newstyle_urls
>> Separate the name=value pairs in CGI parameter query strings
>> with semicolons rather than ampersands. For example:
>>
>> ?name=fred;age=24;favorite_color=3
>>
>> Semicolon-delimited query strings are always accepted, but will
>> not be emitted by self_url() and query_string() unless the
>> -newstyle_urls pragma is specified.

I still use '&' instead of ';'. Perhaps the Perl 5.6 version
of CGI.pm prefers the ';' style, or maybe the the CGI uses
-newstyle_urls.

HTH