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»