in reply to Re^2: compiling Perl on Win32 so I can use Inline::C
in thread compiling Perl on Win32 so I can use Inline::C
In one word, YES.
Read 1 byte at a time:
read() # when reading from a file, or unpack() # using b or B in the template when reading from a string
Bit shift left 3 bits:
$a = $b << 3;
Bit shift right 2 bits:
$a = $b >> 2;
Bitwise AND:
$c = $a & $b;
Bitwise OR:
$c = $a | $b;
Bitwise XOR:
$c = $a ^ $b;
Binary to hex conversion (4 bits at a time):
(or something similar using the sprintf function)$hex =~ s/([01]{4})/sprintf("%.1x", eval('0b'.$binary))/eg;
--------------------
mlh2003
mlh2003
|
---|
In Section
Seekers of Perl Wisdom