SavannahLion has asked for the wisdom of the Perl Monks concerning the following question:
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
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.while (<FILE>) { #Random code }
Edit: Fixed incorrect code example
----
Thanks for your patience.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unix and Windows CRLF vs LF
by cdarke (Prior) on May 13, 2009 at 11:28 UTC | |
|
Re: Unix and Windows CRLF vs LF
by Burak (Chaplain) on May 13, 2009 at 06:02 UTC | |
by targetsmart (Curate) on May 13, 2009 at 07:11 UTC | |
by SavannahLion (Pilgrim) on May 13, 2009 at 06:19 UTC | |
by nikosv (Deacon) on May 13, 2009 at 07:06 UTC | |
|
Re: Unix and Windows CRLF vs LF
by planetscape (Chancellor) on May 13, 2009 at 15:56 UTC | |
|
Re: Unix and Windows CRLF vs LF
by ikegami (Patriarch) on May 13, 2009 at 16:17 UTC | |
|
Re: Unix and Windows CRLF vs LF
by bobf (Monsignor) on May 15, 2009 at 03:25 UTC | |
|
Re: Unix and Windows CRLF vs LF
by SavannahLion (Pilgrim) on Jun 05, 2009 at 06:40 UTC | |
by ikegami (Patriarch) on Jun 05, 2009 at 08:46 UTC |