Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://736566]
help
Chatterbox?
[erix]: and good morning (sorry :))
[Corion]: erix: Naah, I just saw the announcement and remembered that discussion. Maybe I'll try building a DBD::SQLite with the zip stuff built-in, just for fun
[Corion]: Oh - and a good morning to you too :)
[erix]: we have these largish series (dozens) of largisch (1-2 GB) tabsep files that might be shrunk a bit in this way. Bound to get a bit slower but that doesn't matter too much for us

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2018-01-24 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (256 votes). Check out past polls.

    Notices?