aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-286/jo-37/perl/ch-1.pl7
-rwxr-xr-xchallenge-286/jo-37/perl/ch-1a.sh7
2 files changed, 14 insertions, 0 deletions
diff --git a/challenge-286/jo-37/perl/ch-1.pl b/challenge-286/jo-37/perl/ch-1.pl
new file mode 100755
index 0000000000..ad5d8fd247
--- /dev/null
+++ b/challenge-286/jo-37/perl/ch-1.pl
@@ -0,0 +1,7 @@
+#!/usr/bin/perl -w0777
+
+use v5.12;
+seek DATA, 0, 0;
+say +(keys %{ {<DATA> =~ /(\S+)()/g} })[0];
+__DATA__
+Hello David!
diff --git a/challenge-286/jo-37/perl/ch-1a.sh b/challenge-286/jo-37/perl/ch-1a.sh
new file mode 100755
index 0000000000..9386ee22f8
--- /dev/null
+++ b/challenge-286/jo-37/perl/ch-1a.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# usage: ch-1.sh [N]
+# call ch-1.pl N times (default: 80), count the individual printed words
+# and sort by frequency
+
+for i in $(seq 1 ${1:-80}); do ./ch-1.pl; done | sort | uniq -c | sort -n