Any "modern, efficient" method of finding primes is
very advanced math intensive.
Applied Cryptography
has a good section of prime factoring and determining if a number
is likely prime. Public key encryption systems based on
large prime numbers (RSA) don't actually factor the large
prime numbers. They generate numbers using a technique that
ensures that they are probably prime. This is a great shortcut,
but won't work for claiming a mathematical record like you are
proposing as the number is only probably prime (extremely high certainty that it
is prime, but still not %100 guaranteed).
There are many simple prime number algorightms around, unfortunately
the simple ones aren't efficient. The Sieve of Erastothenes
is a classic example. I do not know of any perl modules
that explicitly implement prime number type functionality.
Below is a simple and extermely inefficient is_prime
function.
sub is_prime{
my $n=shift;
return 0 if($n != int($n));
my $m=sqrt($n);
for(my $c=2;$c<=$m;$c++){
return 0 if($n/$c == int($n/$c));
}
return 1;
}
Any way you slice it, I don't think Perl is the
best language for a high performance
prime number analyzer.
Your best bet would be to find a language
designed explicitly
for doing large number math if you seriously want to go
after a "largest prime number" record.