In this case I'd stick with the suggestion provided by haukex: Dump your input and output files with a tool like hexdump.
There is a chance that while changing your version of Perl you might also have changed "something else" in your environment (e.g. a console default encoding).