<div>The code I'm keeping updated has lots of lines like this:</div><div> $cgi = CGI->new();</div><div> $report = $cgi->{report};</div><div><br></div><div>(To pull in the "report=" value from the URL: <a href="http://testrh6/bin/test.cgi?report=MyReportName">http://testrh6/bin/test.cgi?report=MyReportName</a>)</div>
<div><br></div><div>When I was testing it on a RedHat 6 system running Perl 5.10.1, the $report variable was coming up as undefined, but on the test systems running Perl 5.8, it was just fine.</div><div><br></div><div>The fix is to use the param() method like this:</div>
<div> $report = $cgi->param('report');</div><div><br></div><div>Looks like I have a lot of code to fix. (IMHO it was broken before, just Perl was being nice about it...)</div><div><br></div><div>Question: Did I miss this change, or did someone at RH mis-apply a patch? (I am leaning toward a functional change to increase security and make the CGI object more OO-correct...) I read the Perl change logs from 5.8 through 5.10.1 but didn't see this noted.</div>
<div><br></div><div>Dan</div><div><br></div><div>Here's my test code:</div><div><div> 1 #!/usr/bin/perl -w</div><div> 2 use strict;</div><div> 3 use CGI;</div><div> 4 use Data::Dumper;</div><div> 5 my $perl_version = $];</div>
<div> 6 my $cgi;</div><div> 7 my $report;</div><div> 8</div><div> 9 print "Content-type: text/html\n\n";</div><div> 10 print "<html><head>\n";</div><div> 11 print "<title>CGI Test</title>\n";</div>
<div> 12 print "</head>\n";</div><div> 13 print "<body>\n";</div><div> 14 print "Testing with version: $perl_version\n";</div><div> 15 print "<pre>";</div>
<div> 16 # Create CGI object</div><div> 17 $cgi = CGI->new();</div><div> 18</div><div> 19 $report = $cgi->{report};</div><div> 20 print "Raw report variable:";</div><div> 21 print Dumper $report;</div>
<div> 22 print "\n";</div><div> 23</div><div> 24 $report = $cgi->param('report');</div><div> 25 print "Report variable with param:";</div><div> 26 print Dumper $report;</div>
<div> 27 print "\n";</div><div> 28 print "<\pre>";</div><div> 29 exit;</div><div><br></div><div>On CentOS 5.5, the page reports this:</div><div><div>Testing with version: 5.008008</div>
<div>Raw report variable:$VAR1 = [</div><div> 'MyReportName'</div><div> ];</div><div><br></div><div>Report variable with param:$VAR1 = 'MyReportName';</div></div><div><br></div><div><br></div>
<div>On the RedHat 6 box, this is the output:</div><div>Testing with version: 5.010001</div><div>Raw report variable:$VAR1 = undef;</div><div><br></div><div>Report variable with param:$VAR1 = 'MyReportName';</div>
<div><br></div>-- <br>***************** ************* *********** ******* ***** *** **<br>"Quis custodiet ipsos custodes?"<br> (Who can watch the watchmen?)<br> -- from the Satires of Juvenal<br>"I do not fear computers, I fear the lack of them."<br>
-- Isaac Asimov (Author)<br>** *** ***** ******* *********** ************* *****************<br>
</div>