my $file =... open (TEMP, $file) or die("Error: cannot open $file\n"); my $outfile =...