in reply to Binmode problem

I have a feeling you are opening the file with your editor before you check the for spaces. My bet is your editor is set to change tab to 8 spaces and then you're saving the change.

Look at the file with hexdump before you do anything with it.