Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: binary string

by borisz (Canon)
on Jan 15, 2009 at 15:28 UTC ( #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


Comment on Re: binary string
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-07-13 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (250 votes), past polls