[EMAIL PROTECTED] wrote:
> Hi,
> Among other data, a binary file contains the bytes "00A5".
> I am trying to read these four bytes and get the decimal equivalent as
> follows:
[snip]
> read(FD, $buf, 4); $buf -> "00A5"
I'm not sure I follow. Are you saying the characters in buf are
>Hi,
>Among other data, a binary file contains the bytes "00A5".
>I am trying to read these four bytes and get the decimal equivalent as
-
$POST_DATA =~ s/(\w\w)/chr (hex($1))/eg;
this is a line from one of my programs where i send data from another
program in the form of argueme
Hi,
Among other data, a binary file contains the bytes "00A5".
I am trying to read these four bytes and get the decimal equivalent as
follows:
..
$buf;
$hex_val;
$dec_val;
read(FD, $buf, 4); $buf -> "00A5"
$hex_val = unpack("H*", $buf);
$dec_val = hex($hex_val);
...
Is there a way in wh