Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Number of bits, length of RegExp (not a regex)

by Aristotle (Chancellor)
on Apr 21, 2003 at 17:18 UTC ( [id://252057]=note: print w/replies, xml ) Need Help??


in reply to Number of bits, length of RegExp

#!/usr/bin/perl -w use strict; sub is_odd { unpack "%1b*", pack "b*", shift } for(1..10) { print is_odd("1" x $_), "\n"; } __END__ 1 0 1 0 1 0 1 0 1 0

Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-19 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found