amelinda has asked for the wisdom of the Perl Monks concerning the following question:
Why am I going nuts, you ask? Why not use CGI.pm's handy upload() feature? Simple. That feature doesn't start until 2.47. I get 2.36. Before anyone says "install the new version" or "get them to install the new version" or even "install the new version in your directory": I can't. I've already asked the sysadmin to install it, but can't wait that long. I only have FTP access, so I'm not sure how to install through FTP. Thus, my request for some helpful help.
This is the minim case, and it fails. Why? I have no idea. Apparently, I don't get CGI::Carp, either.#!/usr/bin/perl -w use strict; use CGI qw(:standard); my $query = new CGI; print header; print start_html; my $user = $query->param('user'); my $password = $query->param('password'); { no strict; $filename = $query->param('foofile'); undef $/; $buffer = <$filename>; $buffer =~ tr/\r\n/\n/; @buffer= split /\n/, $buffer; } print $buffer[0]; print end_html;
The undef $/; and tr bits are there for nasty file conversion issues.
Basically what seems to be happening is that @buffer is not global, so I can't see it outside that no strict; block. So I tried to put in, before that block, a my @buffer; line. That fails too.
I thought about trying to wade through CGI.pm and cut-n-pasting some code, but I'm kind of in a time crunch, and this almost works. :sigh:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: CGI Upload with OLD CGI.pm
by tye (Sage) on Oct 17, 2001 at 22:44 UTC | |
by amelinda (Friar) on Oct 17, 2001 at 23:34 UTC | |
by George_Sherston (Vicar) on Oct 17, 2001 at 23:50 UTC | |
|
Re: CGI Upload with OLD CGI.pm
by chromatic (Archbishop) on Oct 17, 2001 at 22:47 UTC | |
by amelinda (Friar) on Oct 17, 2001 at 23:19 UTC | |
|
Re: CGI Upload with OLD CGI.pm
by amelinda (Friar) on Oct 18, 2001 at 03:39 UTC | |
|
Re: CGI Upload with OLD CGI.pm
by amelinda (Friar) on Oct 17, 2001 at 22:23 UTC | |
|
(tye)Re2: CGI Upload with OLD CGI.pm
by tye (Sage) on Oct 18, 2001 at 18:59 UTC |