aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Sommrey <28217714+jo-37@users.noreply.github.com>2024-10-04 13:21:34 +0200
committerJörg Sommrey <28217714+jo-37@users.noreply.github.com>2024-10-04 16:35:19 +0200
commit43cd4fb9132ad166678c60909d2de3eacff39a12 (patch)
tree9e9702f85b9a21b7e94f4a25973038eb558aabdf
parent1b91ff7997d2e7782f0154161a0c10a8be8a1d69 (diff)
downloadperlweeklychallenge-club-43cd4fb9132ad166678c60909d2de3eacff39a12.tar.gz
perlweeklychallenge-club-43cd4fb9132ad166678c60909d2de3eacff39a12.tar.bz2
perlweeklychallenge-club-43cd4fb9132ad166678c60909d2de3eacff39a12.zip
Solution to task 2
-rwxr-xr-xchallenge-289/jo-37/perl/ch-2.pl17
1 files changed, 17 insertions, 0 deletions
diff --git a/challenge-289/jo-37/perl/ch-2.pl b/challenge-289/jo-37/perl/ch-2.pl
new file mode 100755
index 0000000000..905b9034e9
--- /dev/null
+++ b/challenge-289/jo-37/perl/ch-2.pl
@@ -0,0 +1,17 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use List::Util 'shuffle';
+
+
+srand time;
+while (<>) {
+ print s{
+ (?<![[:alpha:]].)
+ (?<=[[:alpha:]])
+ ([[:alpha:]]{2,})
+ (?=[[:alpha:]])
+ (?!.[[:alpha:]])
+ }{join '', shuffle split //, $1}grex;
+}