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:
In reply to CGI Upload with OLD CGI.pm by amelinda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |