From 572ff4cc7005cc895c3a4544d6bb915359388b40 Mon Sep 17 00:00:00 2001 From: Abigail Date: Sun, 5 Dec 2021 19:50:01 +0100 Subject: Use same variable name as other solutions --- challenge-141/abigail/perl/ch-2.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/challenge-141/abigail/perl/ch-2.pl b/challenge-141/abigail/perl/ch-2.pl index 3417e54e1d..a8f61aab79 100644 --- a/challenge-141/abigail/perl/ch-2.pl +++ b/challenge-141/abigail/perl/ch-2.pl @@ -65,10 +65,10 @@ sub substrings ($n, $m, $prefix = -1, $max = $n) { # Recurse, once by picking up the first character of $n, and # once by skipping the first character. # - my $fc = substr ($n, 0, 1); - my $next = 10 * ($prefix == -1 ? 0 : $prefix) + $fc; - substrings (substr ($n, 1), $m, $next, $max) + - substrings (substr ($n, 1), $m, $prefix, $max); + my $fc = substr ($n, 0, 1); + my $n_prefix = 10 * ($prefix == -1 ? 0 : $prefix) + $fc; + substrings (substr ($n, 1), $m, $n_prefix, $max) + + substrings (substr ($n, 1), $m, $prefix, $max); } -- cgit