My SearchFU needs help. :( I remember dealing with exactly this sort of thing many moons ago, but I can't remember how I eventually resolved this. My gut tells me that I changed how \n was defined and how Perl eats files. I'm chewing through files line by line using

while (<FILE>) { #Random code }
Works fine on my sample set, until I realize the working data actually consists of text files from a variety of flavors of Windows and Unix. Oops! Now I can't eat the files line by line. I could eat slurp the files whole, do a bit of substitution for \r & \n and deal with it that way. But that's an ugly solution and I can't gamble the files are consistently small enough to gobble up like that. Can someone point me in the right direction? I've been mucking with the Camel book for a while and my eyes are starting to water.

Edit: Fixed incorrect code example

----
Thanks for your patience.


In reply to Unix and Windows CRLF vs LF by SavannahLion

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.