while () { #removes the UNIX style newline chomp; #do something else and then print to the OUTPUT file #using DOS style new line print OUTPUT, $line_content, "\r\n"; }