while () { chomp; #remove line endings print "$_\n"; #write this OS's line ending }