Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: to be or not to be...

by Rich36 (Chaplain)
on Apr 08, 2003 at 15:23 UTC ( #248965=note: print w/replies, xml ) Need Help??


in reply to to be or not to be...

Or you could do it conditionally. Prints either 2 B's or something that's not 2 B's.

#!/usr/local/bin/perl -l foreach ('b', 'bb', 'B', 'foo', 'bar', 'BB') { print m/^b{2}$/i ? "\x42\x42" : bb(); } sub bb() { while(1) { return chr(rand(100)) . chr(rand(100)) unless (m/^b{2}$ +/i); } }

«Rich36»

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2021-04-12 07:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?