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