简体   繁体   中英

Perl CGI: query parameters are munged following Perl upgrade

We recently upgraded Perl from 5.8.4 to 5.16.1 (CGI version 3.59). My web app has several pages which all pass data from one to the next via CGI forms. When I insert a $query->Dump into each page, the first two pages are fine, but the third has completely munged data. The name/value pairs aren't what you'd expect, there are names that shouldn't exist, etc. For example. page 2 contains expected name/value pairs:

Content-Type: text/html; charset=ISO-8859-1

. selectedOrganism
    All
.  selectedExpters
    All
    LKRAMER

while page 3 has munged name/value pairs including:

. -----------------------------17694310364738783961604838496" 

   <with 12 null values>

. Content-Disposition: form-data

. All
     <3 null values>

. LKRAMER

     <null value>

This is running on our development box; our production box hasn't been upgraded yet, the code is the same and there is no problem.

I found the problem. Instead of instantiating the query object as:

    my $query = new CGI;

The code had:

    my $query = CGI->new(\*STDIN);   

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM