Hi all,

I am fighting with the following short test script, and I can make it work
only if I use a subroutine.
I want to make it work without a subroutine.

The script works as it is, but if I remove the line that runs the
subroutine, and the
first and last lines of the subroutine (sub up { ... and }), the script
doesn't want to run normally.

It will copy the file, but in addition, it will create the same file but
with a strange name (CGItem0995... or other random numbers) in my cgi-bin
directory.

Why is different if I use the subroutine?

Thank you. Here is the script:

#!c:\perl\bin\perl.exe

use CGI;
my $GET = new CGI; # create a new object

print "Content-type: text/html\n\n";
print "Upload completed<br>";

&up; #I tried to comment this line

sub up { #I tried to comment this line too.
my $file = $GET->param("file");
open (NEW, ">c:\\Program Files\\Apache Group\\Apache\\images\\MAIL.dbx");
binmode NEW;
open (INPUT, "$file");
binmode INPUT;
while (read(INPUT, $buffer, 1024)) {
print NEW $buffer;
}
close NEW;
close INPUT;
#End the subroutine
}    # I also tried to comment this line

Teddy,
My dear email address is [EMAIL PROTECTED]



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to