diff options
| author | Abigail <abigail@abigail.be> | 2021-01-18 13:58:22 +0100 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-01-18 13:58:22 +0100 |
| commit | ace53ffec67794fec91f402c89dbb1f4d2c42bf8 (patch) | |
| tree | cbc3e29993fce712cdf684f5f58c35ffab354066 | |
| parent | 2a05f98302637a957d242511fb4ef94db4c6b716 (diff) | |
| download | perlweeklychallenge-club-ace53ffec67794fec91f402c89dbb1f4d2c42bf8.tar.gz perlweeklychallenge-club-ace53ffec67794fec91f402c89dbb1f4d2c42bf8.tar.bz2 perlweeklychallenge-club-ace53ffec67794fec91f402c89dbb1f4d2c42bf8.zip | |
Perl solution for week 96/part 1
| -rw-r--r-- | challenge-096/abigail/perl/ch-1.pl | 33 |
1 files changed, 33 insertions, 0 deletions
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 <>; |
