in reply to Why chomp doesn't work?
No, chomp works fine. On Unix the end of line \n is a single \cJ character, which is what it's removing. On CP/M derivatives it's \cM\cJ, so on wintendo it's removed correctly. Your problem is that you're transferring your file in such a way that it's preserving the other platform's end of line marker. Either transfer the file in such a way that line endings are translated, or use something like dos2unix to correct the line endings beforehand (or just use the same s/\cM+$// after the chomp to be sure).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why chomp doesn't work?
by bart (Canon) on Jun 14, 2004 at 13:35 UTC | |
by Fletch (Bishop) on Jun 14, 2004 at 14:14 UTC |