I have a script that is appending new fields to an existing CSV, however ^M characters are appearing at the end of the old lines so the new fields end up on a n
^M
To convert DOS style to UNIX style line endings:
for ($line in ) { $line =~ s/\r\n$/\n/; }
Or, to remove UNIX and/or DOS style line endings:
for ($line in ) { $line =~ s/\r?\n$//; }