Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: compiling Perl on Win32 so I can use Inline::C

by mlh2003 (Scribe)
on Mar 03, 2005 at 03:38 UTC ( #436081=note: print w/replies, xml ) Need Help??


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):

$hex =~ s/([01]{4})/sprintf("%.1x", eval('0b'.$binary))/eg;
(or something similar using the sprintf function)

--------------------
mlh2003

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://436081]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2021-10-22 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?