Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 chilling in the Monastery: (4)
As of 2024-03-29 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found