Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: binary string

by borisz (Canon)
on Jan 15, 2009 at 15:28 UTC ( [id://736566]=note: print w/replies, xml ) Need Help??


in reply to binary string

Assuming you want increment $cnt by one, even if more as one pattern match per byte.
my $cnt = 0; for my $num ( 0 .. 127 ) { $cnt++ if ( ( $num & 0xc0 ) == 0 || ( $num & 0x30 ) == 0 || ( $num & 0x0c ) == 0 || ( $num & 0x03 ) == 0 ); } print $cnt;
Boris

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-03-28 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found