请求高手解决啊

请求高手解决啊

请求高手解决啊
enctype="multipart/form-data"
如果在<form>加入了下面的项目:
<form name="form1" onsubmit="return check_character()" method="post" onreset="form1.B1.disabled=false;form1.B2.disabled=true;form1.B3.disabled=true;" enctype="multipart/form-data">

就无法通过read(STDIN, $str, $ENV{'CONTENT_LENGTH'});获取环境变量
请问还有什么可以获取环境变量的方法吗?主要是为了实现向服务器传递文件,所以有下面的指令:
其中:F1是“上传文件”的name
my $query = new CGI;
my $fH = $query->upload('F1');
my $fH = $query->para.
my $fH = $query->param('F1');
我的问题
我用了网上提供的那个很经典的程序,服务器也没什么错误,怎么就是传不上去呢?程序给大家
#!/usr/bin/perl
#######################################
## perl services upload helper v1.0 ##
## http://www.perlservices.com ##
## perlservices@perlservices.com ##
## ###########################################
## you should carefully read all of the following terms and conditions ##
## before using this program. your use of this software indicates your ##
## acceptance of this license agreement and warranty. ##
## this program is being distributed as freeware. it may be used ##
## free of charge, but not modified below the line specified. this copyright ##
## must remain intact. ##
## ##
## by using this program you agree to indemnify perl services from any ##
## liability. ##
## ##
## selling the code for this program without prior written consent is ##
## expressly forbidden. obtain permission before redistributing this ##
## program over the internet or in any other medium. in all cases the ##
## copyright must remain intact. ##
## ##
## there are security hazards involved with this script. read the readme file##
## before using the script. ##
################################################################################

##
## start setting up options here:

## your path to where you want your files uploaded.
## note: no trailing slash
$basedir = "/home/ylbai/";

## do you wish to allow all file types? yes/no (no capital letters)
$allowall = "yes";

## if the above = "no"; then which is the only extention to allow?
## remember to have the last 4 characters i.e. .ext
## $theext = ".jpg";

## the page you wish it to forward to when done:
## i.e. http://www.mydomainname.com/thankyou.html
$donepage = "http://172.171.85.78";

################################################
################################################
## do not edit or copy below this line ##
################################################
################################################







use CGI;
$onnum = 1;

while ($onnum != 11) {
my $req = new CGI;
my $file = $req->param("FILE$onnum");
if ($file ne "") {
my $fileName = $file;
$fileName =~ s!^.*(\\|\/)!!;
$newmain = $fileName;
if ($allowall ne "yes") {
if (lc(substr($newmain,length($newmain) - 4,4)) ne $theext){
$filenotgood = "yes";
}
}
if ($filenotgood ne "yes") {
open (OUTFILE, ">$basedir/$filename");
print "$basedir/$filename<br>";
while (my $bytesread = read($file, my $buffer, 1024)) {
print OUTFILE $buffer;
}
close (OUTFILE);
}
}
$onnum++;
}

print "content-type: text/html\n";
print "location:$donepage\n\n";