in reply to Answer: How do I read an entire file into a string?
in thread files
I noticed that the "end-of-line" for each line is changed from "0d 0a" to "0d 0d 0a"
Windows converts 0x0a to 0x0d 0x0a on output unless the output file handle has been marked binary (as with binmode).
On input, it does the reverse, converting 0x0d 0x0a to 0x0a; if the file hasn't been marked binary..
What is happening in your case is that when the text file is written, 0x0a becomes 0x0d 0x0a. When you read it in as binary, no conversion is done so you get 0x0d 0x0a in memory...
But when you print it to the text mode screen, the automatic conversion is done (again), so 0x0d 0x0a becomes 0x0d 0x0d 0x0a as you are seeing.