open OUTFILE, ">${TempPath}$ImageFileName"; while (<$image_file>) { print OUTFILE $_; } close OUTFILE;