aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-160/maxim-kolodyazhny/perl/ch-1.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-160/maxim-kolodyazhny/perl/ch-1.pl b/challenge-160/maxim-kolodyazhny/perl/ch-1.pl
new file mode 100644
index 0000000000..bdb4c1ebca
--- /dev/null
+++ b/challenge-160/maxim-kolodyazhny/perl/ch-1.pl
@@ -0,0 +1,13 @@
+#!/usr/bin/env perl
+
+# perl ch-1.pl 7
+use v5.20;
+
+$_ = pop;
+
+my @n = qw( 0 one two three four five six seven eight nine );
+my %l = map { $a++, length } @n;
+
+1while s/[^4]$/$n[$&] is $n[$l{$&}], $l{$&}/;
+
+say ucfirst s/4/four is magic./r