in reply to Re^2: Why does my Perl regex substitution for linebreak fail?
in thread Why does my Perl regex substitution for linebreak fail?

Line-endings: \r and \n (CR and LF)

Exactly how pc line-ending got in your file, I couldn't say but I would guess that the data has passed through a windows machine at sometime. Some file transfer methods take care of line-endings and others don't.

  • Comment on Re^3: Why does my Perl regex substitution for linebreak fail?

Replies are listed 'Best First'.
Re^4: Why does my Perl regex substitution for linebreak fail?
by pat_mc (Pilgrim) on Mar 06, 2008 at 20:33 UTC
    Good stuff, igelkott.

    Thanks a million for your help! I'll spend some more time wondering just how the \r got in there.

    Just out of curiosity - could it have crept in due to any of my Linux or text editor settings - or maybe even character encodings? I checked for the obvious (to me) editor settings in KWrite but could not spot any pointers to Windows formats there.
    Also, the file did not get routed through the network at any point in time ... oh, wait a minute: I did send a copy of it via uuencode. Would that have done anything to the original file? Probably not ...

    Cheers -

    Pat
      In the Kwrite menu, check Tools -> End of Line.

      I've never heard of uuencode doing something like this.