system "rm file2"; open(FILE2, ">file2"); open(MYINPUTFILE, "file"); if ( -s file ){ while() { my($line) = $_; chomp($line); print FILE2 "$line\n"; print FILE2 "you need to do this\n"; print FILE " \n"; } else { print FILE2 "There is nothing to do\n"; } }