http://www.perlmonks.org?node_id=1018163


in reply to delete FF's from a file

i have this file in binmode (its hex bin)...

This is a common source of confusion that people think processors use hexidecimal internally. The processor uses binary and the file is in binary. Hexidecimal is a representation shown on the screen or in a string, etc. that is easier for humans to use than binary. Searching for 'FF's in a binary file is not what you want. You want the binary value represented by the hex number 'FF'.