in reply to Re: Clean line ends
in thread Clean line ends

I'm sure that works.

But I find I sometimes get confused about how Perl inteprets \n (sometimes it's \012 and sometimes it's \015\012 - see perlport for the details). In order to minimise my confusion I find it helpful to always refer to the control characters (\cJ and \cM) or the numeric character codes (\012 and \015) when I'm converting newline characters.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^3: Clean line ends
by smithers (Friar) on Jan 19, 2007 at 19:04 UTC
    I also found David Cross' explanation of differing line end chars very helpful. See his book "Data Munging w/Perl", page 88-89. The topic is very well explained and it was an eye-opener to me when I was confused about new lines for different platforms. Sorry to point you to a book but I think David's book is excellent and his coverage of this particular topic is helpful.
      I also found David Cross' explanation of differing line end chars very helpful.

      Very kind of you to say so. Thanks :-)

      --
      <http://dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg

      Hello David. Sorry to be a book fan-boy but your Data Munging book is terrific. The chapters on parsing are beyond my *current* skill level but I read everthing else in your book cover-to-cover. Thanks for your quick post above as now I have more of your content available via the links you provide on your page. It's nice to be able to tell you that your book is one of my favorite Perl books.