sub isPrime($) { $n=pop; 1^(1x$n--)=~/^(1{2,$n})\1+$/; } #### sub isPrime($) { (1x pop)!~/^(11+)\1+$/ }