$foo !~ /^(?: .? | (..+) \1+ # true if foo is of prime length I'm not taking notes. I can't handle it. If I don't survive this talk, tell my wife I love her.