in reply to Weird Character in File Makes Perl Think it's EOF

Perl hasn't behaved that way for 6.5 years.

>perl -e"print qq{abc\n\cZdef\n}" | c:\progs\perl560\bin\perl -e"while + (<>) { chomp; print qq{[$_]\n} }" [abc] >perl -e"print qq{abc\n\cZdef\n}" | c:\progs\perl561\bin\perl -e"while + (<>) { chomp; print qq{[$_]\n} }" [abc] >perl -e"print qq{abc\n\cZdef\n}" | c:\progs\perl580\bin\perl -e"while + (<>) { chomp; print qq{[$_]\n} }" [abc] [&#8594;def] >perl -e"print qq{abc\n\cZdef\n}" | c:\progs\perl588\bin\perl -e"while + (<>) { chomp; print qq{[$_]\n} }" [abc] [&#8594;def] >perl -e"print qq{abc\n\cZdef\n}" | c:\progs\perl5100\bin\perl -e"whil +e (<>) { chomp; print qq{[$_]\n} }" [abc] [&#8594;def]

Time to upgrade!

5.8.0 is when PerlIO started being used (by ActiveState, at least). Under PerlIO, files are read in "as binary", then they are "converted to text" by the crlf layer if present. The crlf layer doesn't treat chr(26) specially like the old library did.

Note: &#8594; represents character 26.