From c65c694f21ce314c2a47e9a0bf5b4d3a0c993cb4 Mon Sep 17 00:00:00 2001 From: Jose Luis Perez Diez Date: Wed, 7 Oct 2020 19:35:20 +0200 Subject: Add usage information --- challenge-081/jluis/perl/ch-1.pl | 25 +++++++++++++++++++++---- challenge-081/jluis/perl/ch-2.pl | 9 ++++++++- 2 files changed, 29 insertions(+), 5 deletions(-) mode change 100644 => 100755 challenge-081/jluis/perl/ch-1.pl mode change 100644 => 100755 challenge-081/jluis/perl/ch-2.pl diff --git a/challenge-081/jluis/perl/ch-1.pl b/challenge-081/jluis/perl/ch-1.pl old mode 100644 new mode 100755 index 8549a26895..0563d11964 --- a/challenge-081/jluis/perl/ch-1.pl +++ b/challenge-081/jluis/perl/ch-1.pl @@ -2,12 +2,29 @@ use strict; use warnings; +use 5.010; + +if ($#ARGV != 1) { + say <){ chomp; s/\.|"|\(|\)|,|'s|--/ /g; - while (s/\s*(\w+)\s*//) { + while (/(\w+)/g) { $freq{$1} = 0 unless defined $freq{$1}; $freq{$1} += 1; } -- cgit