while (read($fh, $buffer, 1024)) { print $out_handle $buffer; } #### read() on unopened filehandle #### my $handle_in = $cgi->upload('file_image');