Are you, by any chance, writing your binary data to your terminal? In that case the data might contain some control characters which cause the cursor to jump or other things, and as of 2018 your terminal is likely to expect UTF-8 encoded output. Also note that chomp is probably a bad idea on binary data.
For better diagnostics, you should apply binmode to your CMD filehandle and write the output to a file and examine this file.
Edited to add: I just spotted a 0a as the second byte of your bad stream. This is a line feed which will be killed by chomp.In reply to Re: Killer byte tripping up Perl?
by haj
in thread Killer byte tripping up Perl?
by echo5
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |