Monolith-0 has asked for the wisdom of the Perl Monks concerning the following question:
I am looking for a way to read a chunk of bytes from a file and compare it to an array of byte values. I believe my problem is in reading the bytes from the file. I need to somehow get the byte values into an array, but I only know how to read strings (using the read command). Once I get that, I figured I could just use a loop to check each of the values.
On more of a side note, in my original array of values, I hardcoded some of the elements as 'a'. Will this give me the ascii value for that caracter as I expect, or does it not work that way in perl? (I am more used to C++)
Thanks in advance for any help or hints.
- Monolith
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Comparing the bytes of a file
by BrowserUk (Patriarch) on Aug 28, 2002 at 17:48 UTC | |
by Monolith-0 (Beadle) on Aug 28, 2002 at 18:12 UTC | |
|
Re: Comparing the bytes of a file
by sauoq (Abbot) on Aug 28, 2002 at 18:26 UTC | |
|
Re: Comparing the bytes of a file
by zentara (Cardinal) on Aug 29, 2002 at 17:10 UTC | |
|
Re: Comparing the bytes of a file
by valdez (Monsignor) on Aug 28, 2002 at 17:25 UTC |