From ace53ffec67794fec91f402c89dbb1f4d2c42bf8 Mon Sep 17 00:00:00 2001 From: Abigail Date: Mon, 18 Jan 2021 13:58:22 +0100 Subject: Perl solution for week 96/part 1 --- challenge-096/abigail/perl/ch-1.pl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 challenge-096/abigail/perl/ch-1.pl diff --git a/challenge-096/abigail/perl/ch-1.pl b/challenge-096/abigail/perl/ch-1.pl new file mode 100644 index 0000000000..ddca656054 --- /dev/null +++ b/challenge-096/abigail/perl/ch-1.pl @@ -0,0 +1,33 @@ +#!/opt/perl/bin/perl + +use 5.032; + +use strict; +use warnings; +no warnings 'syntax'; + +use experimental 'signatures'; +use experimental 'lexical_subs'; + +# +# For the challenge description, see ../README.md +# + +# +# The challenge doesn't describe what a word is, or what to +# do with things which are neither words, nor whitespace, like +# punctuation. +# +# For instance, what should happen to the sentence: +# +# "The Weekly Challenge, Part 1!" +# +# So, we're using the easy way out, and assume anything which isn't +# whitespace to be part of a word. After all, the examples assumen +# all the world is ASCII letters and spaces. +# +# Which makes the excercise too trivial to be called a challenge. +# + +# Extract 'words', reverse the list, and print it. +say join " " => reverse /\S+/g for <>; -- cgit