in reply to Doesn't work in Cygwin
Check so it isn't confused about 1 or 2 chars end-of-lines. (See what you have after the chomp, either one char to little or an extra \n.)
(It is a potential mess. You can configure Cygwin for how it should treat eol:s. Also, if you wrote the data file in Unix and copied over the file in bin format, you'd get a single \n.)
Update:
Should add some code that do reading w/out extra chars in Cygwin, as bart did. This works for me in fixing up mixed files (I use an old version of Ultraedit that mixes line endings! Don't use Win much).
while(<$fh>) { chop; chop if /\015$/; print UT $_; print UT "\012"; } close $fh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Doesn't work in Cygwin
by bart (Canon) on Nov 16, 2005 at 12:28 UTC | |
by maybeD (Sexton) on Nov 16, 2005 at 12:58 UTC | |
by bart (Canon) on Nov 16, 2005 at 17:17 UTC |