<br><br><div class="gmail_quote">On Thu, Mar 26, 2009 at 11:38 AM, Jay Hannah <span dir="ltr"><<a href="mailto:jay@jays.net">jay@jays.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Mike Hostetler wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So . . . it there a way I could get Perl to detect a file that uses CRLF as<br>
it's line terminator? That way, I could use binmode on that file, and use<br>
ASCII on the rest. Or does someone have a better suggestion?<br>
<br>
</blockquote>
<br></div>
binmode is for binary files.<br>
<br>
CRLF (\r\n Windows) and LF (\n *nix) are for text files.<br>
<br>
I think you are confusing those two issues. They are not related. When reading a file you could<br>
<br>
while (<IN>) {<br>
s/[\r\n]+$//;<br>
<br>
to remove those characters regardless of which format any given file was written in.<br>
<br>
Does that help? :)<br>
</blockquote><div><br>That does help.<br><br>I mentioned binmode because I saw several references to that, but your solution is better. <br><br>I knew someone would know more than me. I just moonlight in Perl. :)<br><br>
<br></div></div>-- <br>Mike Hostetler<br><a href="http://mike.hostetlerhome.com/">http://mike.hostetlerhome.com/</a><br><br><br>