in reply to Special characters ignored

I just did a test with perl 5.6.1 and 5.005_03 (running on Linux), both of which successfully returned length five with the code and example file you listed above.

Perhaps you're dealing with an operating system which cares about text files vs binary files, and is stripping the last three characters because it thinks you're in text mode. Try a binmode(FILE) immediately after your open, this should let you read all data (including line-breaks and end-of-file characters) without any interpretation going on.

Cheers,
Paul