in reply to Re^8: Error binmode() on unopened filehandle
in thread Error binmode() on unopened filehandle

As I understand it, in this particular case the CRs (carriage returns) are never there (in $data) to begin with. A here-doc is just another way to compose a string, in this case with double-quote interpolation (but that has no bearing here). Each line ends in a single \n (newline) character.

Not exactly right...The <CR>'s are there in the source Windows file but, the here-doc strips the <CR>'s out. I personally recommend using binary read() instead of the <> operator for actual files. I guess we are talking here about how to imbed binary data into a Perl source file?

Note that on old Mac's, the text line ending is <CR> instead of <CR><LF> or <LF>.

  • Comment on Re^9: Error binmode() on unopened filehandle