aboutsummaryrefslogtreecommitdiff
path: root/challenge-097/abigail/perl
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2021-01-25 20:10:22 +0100
committerAbigail <abigail@abigail.be>2021-01-26 12:07:41 +0100
commit6c5715542385de49f20d0f56d1c9aa66b5736cab (patch)
tree4fb675143681b42b027f511f463e462b0ead76d8 /challenge-097/abigail/perl
parent2f7c1b777992058c0b7d4082435e2db27253a871 (diff)
downloadperlweeklychallenge-club-6c5715542385de49f20d0f56d1c9aa66b5736cab.tar.gz
perlweeklychallenge-club-6c5715542385de49f20d0f56d1c9aa66b5736cab.tar.bz2
perlweeklychallenge-club-6c5715542385de49f20d0f56d1c9aa66b5736cab.zip
Perl solution for week 97, part 1
Diffstat (limited to 'challenge-097/abigail/perl')
-rw-r--r--challenge-097/abigail/perl/ch-1.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/challenge-097/abigail/perl/ch-1.pl b/challenge-097/abigail/perl/ch-1.pl
new file mode 100644
index 0000000000..9ffda0a6e5
--- /dev/null
+++ b/challenge-097/abigail/perl/ch-1.pl
@@ -0,0 +1,26 @@
+#!/opt/perl/bin/perl
+
+use 5.032;
+
+use strict;
+use warnings;
+no warnings 'syntax';
+
+use experimental 'signatures';
+use experimental 'lexical_subs';
+
+#
+# See ../README.md
+#
+
+#
+# Run as: perl ch-1.pl < input-file
+#
+
+while (<>) {
+ chomp;
+ my ($times, $plain) = split ' ', $_, 2;
+ $times %= 26;
+ $plain =~ y/A-Z/ZA-Y/ for 1 .. $times;
+ say $plain;
+}