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: 73378
Status: rejected
Priority: 0/
Queue: CGI

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

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



Subject: upload() does not return open handle (prematurely closed?)
Hello, I've a script that has 2 upload functions: • one uploads from the file handle to disk. • The other attaches the tmp file to an email. The latter works fine. The former stopped working today (no code changes). Before and after the upload() call the object dump is the same (only the tmpfile path is different). Here is the original code: [code] my $cgi = CGI->new(); # no $CGI:: vars set so they are the defaults ... my $tmp_fh = $cgi->upload($param_name); if ( defined $tmp_fh ) { ... [/code] I had to add this after the call to upload() to get it to work: [code] # rt my $upload_hack = ''; if (!defined $tmp_fh) { my $filename = $$cgi->param($param_name); if ($filename) { $upload_hack = $cgi->tmpFileName($filename); open $tmp_fh, '<', $upload_hack; # unlink()d when we're done w/ it } } [/code] Any ideas why it'd be closed? Is there a better way to detect this and reopen? thanks! -- Dan
I'm sorry, we don't have the bandwidth here to answer support requests in the bug tracker. If you aren't sure what's wrong, I recommend asking for support in a forum like perlmonks.org or StackExchange. If you have a Test::More-style test that illustrates a bug in CGI.pm, please follow-up again here.
On Tue Dec 20 12:49:36 2011, MARKSTOS wrote: Show quoted text
> I'm sorry, we don't have the bandwidth here to answer support requests > in the bug tracker.
This was meant more to alert you to the problem not ask what to do about it (i.e. I already have a work around in the original post). Feel free to ignore those questions, I require no answers to them, they were mainly for discussion. Show quoted text
> If you have a Test::More-style test that illustrates a bug in CGI.pm, > please follow-up again here.
I'll see what I can do, it might be tricky since since I've no selinium on my laptop ;) I'll look over the test that CGI/pm has though and see what I can come up with.