in reply to fibonacci regex
Nice, this reminds me of a function to test if a number if prime:
sub isPrime { ('1' x $_[0]) !~ /^(11+)\1+$/; }
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
In Section
Snippets Section
in reply to fibonacci regex
Nice, this reminds me of a function to test if a number if prime:
sub isPrime { ('1' x $_[0]) !~ /^(11+)\1+$/; }
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)