There I do some minor net surfing..and suddenly, I see this page:
Perl Tricks
To see, if a number ($num) is prime.. you just need this:
print „Prime:$num\n“ if (1 x $num) !~ /^1?$|^(11+?)\1+$/;
…and it works!
No Way!
this is awesome!
:)))
There I do some minor net surfing..and suddenly, I see this page:
Perl Tricks
To see, if a number ($num) is prime.. you just need this:
print „Prime:$num\n“ if (1 x $num) !~ /^1?$|^(11+?)\1+$/;
…and it works!
No Way!
this is awesome!
:)))