aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-328/perlboy1967/perl/ch1.pl3
1 files changed, 1 insertions, 2 deletions
diff --git a/challenge-328/perlboy1967/perl/ch1.pl b/challenge-328/perlboy1967/perl/ch1.pl
index 5c5acf09bd..35f624dcdc 100755
--- a/challenge-328/perlboy1967/perl/ch1.pl
+++ b/challenge-328/perlboy1967/perl/ch1.pl
@@ -22,8 +22,7 @@ use exact 'v5.32', -signatures;
sub replaceAllQuestionMarks ($str) {
sub _rep {
my @c = map { $_ // '' } @_;
- my @r = grep !/[$c[0]$c[1]]/, 'a' .. 'c';
- return $c[0].$r[0].$c[1];
+ $c[0].(grep !/[$c[0]$c[1]]/,'a'..'c')[0].$c[1];
}
1 while ($str =~ s/(.)?\?(.)?/_rep($1,$2,$3)/e);
return $str;