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: 34551
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: AVINASH [...] cpan.org
Cc:
AdminCc:

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



Subject: Use of uninitialized value in substitution (s///) at (eval 8) line 23
Version 3.33 did not exhibit this problem. Version 3.35, at new CGI; line in some CGI scripts prints the following message 9 times: Use of uninitialized value in substitution (s///) at (eval 8) line 23 There is no code at line 23, or 8, in the CGI script, nor in CGI.pm. Only some CGI scripts exhibit this problem. perl, v5.8.8 on Fedora Core 7, with a newer CGI.pm installed using CPAN.
On Sun Mar 30 12:45:35 2008, AVINASH wrote: Show quoted text
> Version 3.33 did not exhibit this problem. > > Version 3.35, at new CGI; line in some CGI scripts prints the
following Show quoted text
> message 9 times: > Use of uninitialized value in substitution (s///) at (eval 8) line 23 > > There is no code at line 23, or 8, in the CGI script, nor in CGI.pm. > Only some CGI scripts exhibit this problem. > > perl, v5.8.8 > on Fedora Core 7, with a newer CGI.pm installed using CPAN.
Hi Avinash and Lincoln, I looked into this because Jifty recently started warning like crazy in its tests. It's the following code (which was changed in 3.35.. suspicious!), in CGI's read_multipart: my ($filename) = $header{'Content-Disposition'} =~/ filename=(("[^"]*")|([a-z\d!\#'\*\+,\.^_\`\{\}\| \~]*))/i; $filename =~ s/^"([^"]*)"$/$1/; Replacing it with the following fixes it: my $filename; if (($filename) = $header{'Content-Disposition'} =~/ filename=(("[^"]*")|([a-z\d!\#'\*\+,\.^_\`\{\}\|\~]*))/i) { $filename =~ s/^"([^"]*)"$/$1/; } Shawn M Moore for Best Practical
From: alexmv+pause [...] mit.edu
On Tue Apr 08 05:03:27 2008, SARTAK wrote: Show quoted text
> On Sun Mar 30 12:45:35 2008, AVINASH wrote:
> > Version 3.33 did not exhibit this problem. > > > > Version 3.35, at new CGI; line in some CGI scripts prints the > > following message 9 times: > > Use of uninitialized value in substitution (s///) at (eval 8) line 23
> > [snip] It's the following code (which was changed in 3.35.. > suspicious!), in CGI's read_multipart: > [snip]
There have been a couple releases of CPAN, and this warning is still being emitted in 3.37. The attached patch is all that is needed to fix it -- can it please be applied? Thanks, - Alex, also for Best Practical
diff -ru CGI.pm-3.37/CGI.pm CGI.pm-3.37-patched/CGI.pm --- CGI.pm-3.37/CGI.pm 2008-05-05 15:30:33.000000000 -0400 +++ CGI.pm-3.37-patched/CGI.pm 2008-04-23 09:08:23.000000000 -0400 @@ -3387,7 +3387,7 @@ # content-disposition parsing fail. my ($filename) = $header{'Content-Disposition'} =~/ filename=(("[^"]*")|([a-z\d!\#'\*\+,\.^_\`\{\}\|\~]*))/i; - $filename =~ s/^"([^"]*)"$/$1/ if defined $filename; + $filename =~ s/^"([^"]*)"$/$1/; # Test for Opera's multiple upload feature my($multipart) = ( defined( $header{'Content-Type'} ) && $header{'Content-Type'} =~ /multipart\/mixed/ ) ?
Patch accepted into version 3.38, but I think it is reversed!