what i'm trying to do is open a binary file and read from it...

---\

open ( FD, $filename );
binmode ( FD );

#read two bytes
while (read(FD, $buf, 2)) {
 # hopefully print the hex value of two bytes
 print hex($buf);
}

---/

and what i'm going for here is to read some binary data in and print out the
hexadecimal value of that binary data.

what's happening is very different.  for whatever reason, $buf is not being
treated like an ordinary number... code that does what i want is:

---\

$x = 0xA;
print hex($x);

---/

which prints the value '10'.

what kind of datatype is $buf in the first code snippet?  and can i convert
it so that i can use it like $x in the second code snippet?

i'm using ActivePerl (newest version) on Win2k.

thanks tons!

paul


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to