Hello,
I am trying to convert a binary value into an hexadecimal one. I tried serveral ways, but I didn't succeed.
I tried sprintf and the pack/unpack... but It didn't work.
I have an binary value which is always 19 bits long, and I would like to convert it into an hexvalue.
For example: 0000000011100000011 should be converted into 00703. Some suggestions how I can make this?
Some of my code snippest, how I tried it:
my $hex = sprintf("%x", '0000000011100000011');
or
my $hex = unpack "I", '0000000011100000011';
$hex = sprintf("%x", $hex);
I also tried several other versions, but none of them worked..
Thanks for help..