#!/opt/ZDperl/bin/perl use CGI; use Fcntl qw(:flock); $mycgi = new CGI; print $mycgi->header; # get the file from the input stream $upload = $in{"UPLOAD"}; # check if it's there, and write it to disk if $upload) # if it's plain text { open (TEXT, ">filename.txt") || die "$!"; unless (flock (TEXT, LOCK_EX)) {die "$!";} print"i had to find out if it works\n"; while (<$upload>) { print TEXT ; } close(TEXT);