in reply to perl in DOS woes
See perlfunc:binmode for how to set a filehandle into binary mode.
While your at it, you should look at unpack for a better way of processing your binary data than doing it with ord.