aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-139/james-smith/perl/ch-2.pl5
1 files changed, 2 insertions, 3 deletions
diff --git a/challenge-139/james-smith/perl/ch-2.pl b/challenge-139/james-smith/perl/ch-2.pl
index 85c743084c..674112f00e 100644
--- a/challenge-139/james-smith/perl/ch-2.pl
+++ b/challenge-139/james-smith/perl/ch-2.pl
@@ -5,11 +5,10 @@ use strict;
use warnings;
use feature qw(say);
-my( $N, $p, @primes, @long_primes ) =
- ( @ARGV ? $ARGV[0] : 5, 1, 2 );
+my( $N, @primes, @long_primes ) = ( $ARGV[0]||5, 2 );
O: for( my $p=3; @long_primes<$N; $p+=2 ) {
- ($p % $_) || (next O) for @primes; ## next if not prime...
+ ($p % $_) || (next O) for @primes; ## next if !prime
push @long_primes, $p if $p - rec_len($p) == 1;
push @primes, $p;
}