in reply to Variable blasphemy
this looks like using under Unix a file prepared under Windows.
Under Unix, new line characters are \n (line feed). Under Windows, new line is a combination of two characters: \r\n (carriage return and line feed).
If you chomp a line under Unix (or Linux), it will remove only \n (line feed).
If the file was prepared under Windows, this will leave the carriage return, meaning that the cursor will go back to the start of the line without doing a line feed, thereby clobbering the beginning of the line.
If that's your problem, you could change chomp to:
to remove any combination of the two end-of-line characters at line end.s/[\r\n]+$//;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Variable blasphemy
by SixTheCat (Novice) on Jul 24, 2015 at 15:54 UTC | |
by marinersk (Priest) on Jul 24, 2015 at 20:58 UTC |