#!/usr/local/bin/perl -w use strict; use IO::File; #Open and read In File open(IN, '/myfiles/test/file')||die "Can not open '/myfiles/test/file' :$!\n" while(){ }; close (IN); #Open file for writing open(OUT, '>', $file)||die "Can not open $file :$!\n"; print OUT "...800Lines of output..."; close(OUT);