In most Unix it is just \n, in DOS it's \r\n.
No that's not correct. On DOS and Win32, it's also "\n". You see, the trick is that when reading from a text file, "\015\012" (AKA CRLF, "\r\n") is converted into a bare "\012" (LF, "\n"). Therefore, chomp() doesn't have to remove "\r\n", because there commonly will be, should be, only a bare "\n". And as chomp and $/ only use fixed strings not regexes for their workings, you can't have it both ways at the same time.
And that, boys and girls, is why it doesn't work here. Access does store line endings as CRLF pairs. And that isn't very Perl compatible. Therefore, when reading data from Access in a Perl script, you should always turn CRLF into "\n", and vice versa when storing data back into Access.
| [reply] |
| [reply] |
| [reply] [d/l] |
One correction:
s/in DOS it's \n\r/in DOS it's \r\n/
Sure, blame it on the baby! :-)
Wally Hartshorn
| [reply] |