For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > June 2007 > How can I compare Bytes in a Binary File?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How can I compare Bytes in a Binary File?
Dustin Ho

2007-06-22, 9:59 pm

Hi guys/gals, I'm having a bit of a problem and wondering if anyone
can help.

I've got a binary file here that I'm reading byte by byte and I'm
trying to compare the raw binary data... but I'm running into problems
with bytes without an ASCII representation. For example, if I'm
looking for hex value 58 its fine, because I can just read a byte and
see if ($byte eq "X") since 58 is X in ASCII. What if I want to search
for ff or c6 or something which has no ASCII representation?

Thanks!

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com