Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Bitwise operators on binary objects

by albert (Monk)
on Jan 31, 2011 at 09:02 UTC ( [id://885217]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $string1 = '01010110111000';
    my $string2 = '11101101100010';
    ...
        ( $string1 & $string2 )  =~ tr[1][1],      # count 11
    
    );
    
  2. or download this
    my $len = length $unpacked_string;
    my $packed_string = pack qq{b$len}, $unpacked_string;
    
  3. or download this
    my $unpacked_string = unpack qq{b$len}, $packed_string;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found