aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-139/james-smith/perl/ch-2.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-139/james-smith/perl/ch-2.pl b/challenge-139/james-smith/perl/ch-2.pl
index 8311c8a438..cd0c2c56ca 100644
--- a/challenge-139/james-smith/perl/ch-2.pl
+++ b/challenge-139/james-smith/perl/ch-2.pl
@@ -16,6 +16,6 @@ say $_ for @long_primes;
sub rec_len {
my( $D, $N, $s ) = ( shift, 1, '' );
- ($s,$N) = ( $s.int($N/$D), ($N%$D).0 ) for 0 .. 2*$D;
- $s =~ /(\d+?)\1+$/ ? length $1 : 0;
+ $s.=int($N/$D),$N%=$D,$N.=0 for 0..2*$D;
+ $s =~ /(.+?)\1+$/ ? length $1 : 0;
}