![]() |
|
Do you know where your variables are? | |
PerlMonks |
Re: Printing a String (TOO stupid?)by TGI (Parson) |
on Jun 20, 2014 at 05:06 UTC ( #1090550=note: print w/replies, xml ) | Need Help?? |
Printing is a red-herring here. The real issue is how you open the file. Instead of doing a plain-vanilla open, you want to turn on one of [Perl's amazing IO layers]. In this case :crlf.
The awesome thing about this method, is you automatically translate \r\n to \n, but if the file has plain old \n line endings, the just cruise on through to your code without a problem. You may also notice that I used a 3-argument open with a lexical file handle. This is generally considered to be a good idea.
In Section
Seekers of Perl Wisdom
|
|