First, beware that different browsers send file name differently, if you expect to use that file name. IE sends full file path while Opera sends just the basename of file. And if you want your file saved on host use something like
my $file_name = CGI::param('file_field');
$file_name =~ s:^.*[\\/](.*)$:$1:; # remove path if present
my $fh = CGI::upload('file_field');
if ( $fh ) {
open(OUT, '>', "/dir/to/save/$file_name");
while (<$fh>) { print OUT $_; }
close OUT;
} else {
# handle the error
}
If you don't need the file name you may don't bother about it's correctness and just read from filehandle (which is $fh - the value that CGI::upload gives you) and send file data to whatever destination you need.