if(my $fh = $cgi->upload('upload_file')) { while(<$fh>) { # ... } }