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

People
Owner: MARKSTOS [...] cpan.org
Requestors: ema.zep [...] libero.it
Cc:
AdminCc:

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



Subject: upload bug in CGI.pm 3.21
Date: Tue, 22 Aug 2006 17:15:45 +0200
To: <bug-CGI.pm [...] rt.cpan.org>
From: "Emanuele Zeppieri" <ema.zep [...] libero.it>
I've found a subtle bug in CGI.pm 3.21 (it's basically a typo, but it prevents the uploads). I've also set up the (obvious) patch, wich is both attached to this message and inlined here. Thank you Lincoln for your great work with your *invaluable* CPAN modules! Cheers, Emanuele Zeppieri. ================= --- CGI.pm 2006-08-21 21:09:10.000000000 +0200 +++ CGI.pm.new 2006-08-22 16:32:55.000000000 +0200 @@ -3419,7 +3419,7 @@ 'upload' =><<'END_OF_FUNC', sub upload { my($self,$param_name) = self_or_default(@_); - my @param = grep {ref($_) && defined(fileno($_)}, $self->param($param_name)); + my @param = grep(ref($_) && defined(fileno($_)), $self->param($param_name)); return unless @param; return wantarray ? @param : $param[0]; }

Message body is not shown because sender requested not to inline it.

From: rjk-cpan [...] tamias.net
Note that this syntax error prevents compilation of the upload() method, so it's a serious bug. Ronald
From: MCHING [...] cpan.org
I downloaded 3.22 intended to fix this bug, but the line is now: my @param = grep {ref($_) && defined(fileno($_))} $self->param($param_name)); This also does not compile... extra ) at the end of the line. [/usr/local/src/CGI.pm-3.22]# perl -Mlib=. -MCGI -e '$x = new CGI; $x->upload()'; CGI::upload: syntax error at -e line 1
On Wed Aug 23 21:49:53 2006, MCHING wrote: Show quoted text
> I downloaded 3.22 intended to fix this bug, but the line is now: > > my @param = grep {ref($_) && defined(fileno($_))} > $self->param($param_name)); > > This also does not compile... extra ) at the end of the line. > > [/usr/local/src/CGI.pm-3.22]# perl -Mlib=. -MCGI -e '$x = new CGI; > $x->upload()'; > CGI::upload: syntax error at -e line 1
For some reason the patch I've provided has not been applied (see tickets 21125 and 21126), and unfortunately a syntax error is still present in the upload sub code. So I provide a new patch, this time conforming to the syntax grep BLOCK LIST which the autor seems to prefer. And, *More important*, I've also provided a failing test, as upload() isn't covered in CGI.pm's test suite (please see ticket 21157). Cheers, Emanuele Zeppieri.
From: ema_zep [...] libero.it
This bug is closed now (please see ticket #21157 - thanks Lincoln!). And this ticket is really only a duplication of the ticket #21125, happened by accident. So it's closed ;-) Cheers, Emanuele Zeppieri.