Very interesting. Thanks for writing this up.
This is a bit more Perlish (not that I'm an authority):
sub is_prime {
(1x$_[0]) !~ /^(?:.?|(.{2,}?)\1+)$/;
}
But perhaps less clear to a novice reader. You can also leave off the semicolon.