diff options
| author | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2023-03-26 17:46:18 +0200 |
|---|---|---|
| committer | Jörg Sommrey <28217714+jo-37@users.noreply.github.com> | 2023-04-19 17:15:34 +0200 |
| commit | c422882aed45b070d14feb72cd38637c66feadcf (patch) | |
| tree | cb9d66521bad236c14cf4b105e046248a65a9c56 /challenge-033/jo-37 | |
| parent | 656228529106ea281db656335e5e7a2b44f58b9f (diff) | |
| download | perlweeklychallenge-club-c422882aed45b070d14feb72cd38637c66feadcf.tar.gz perlweeklychallenge-club-c422882aed45b070d14feb72cd38637c66feadcf.tar.bz2 perlweeklychallenge-club-c422882aed45b070d14feb72cd38637c66feadcf.zip | |
Challenge 033 task 1
Diffstat (limited to 'challenge-033/jo-37')
| -rwxr-xr-x | challenge-033/jo-37/perl/ch-1.pl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/challenge-033/jo-37/perl/ch-1.pl b/challenge-033/jo-37/perl/ch-1.pl new file mode 100755 index 0000000000..4b0db0d781 --- /dev/null +++ b/challenge-033/jo-37/perl/ch-1.pl @@ -0,0 +1,23 @@ +#!/usr/bin/perl + +use v5.16; +use warnings; + +die <<EOS unless @ARGV; +usage: $0 [--] [FILE...] + +FILE... + names of files to process. Use '-' for STDIN + +EOS + + + +main: { + my %count; + while (<>) { + my $lc = lc =~ tr/[a-z]//cdr; + $count{$_}++ for split //, $lc; + } + say "$_: $count{$_}" for sort keys %count; +} |
