aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoelle Maslak <jmaslak@antelope.net>2019-10-29 11:21:25 -0500
committerJoelle Maslak <jmaslak@antelope.net>2019-10-29 11:21:25 -0500
commit75b1f01a47600d81e6a553946a9442da8ebfb8f7 (patch)
tree3bf30958bacfa7e8b00e3ea5173cf759b7199205
parenta029e6e6de56a0bd366661672b8f38983f60c55a (diff)
parentb56ea63824a596e572d9dc3473746e01fa524d1c (diff)
downloadperlweeklychallenge-club-75b1f01a47600d81e6a553946a9442da8ebfb8f7.tar.gz
perlweeklychallenge-club-75b1f01a47600d81e6a553946a9442da8ebfb8f7.tar.bz2
perlweeklychallenge-club-75b1f01a47600d81e6a553946a9442da8ebfb8f7.zip
Merge branch 'master' of https://github.com/manwar/perlweeklychallenge-club into joelle-32-1-1
-rw-r--r--challenge-032/andrezgz/perl5/ch-1.pl67
-rw-r--r--challenge-032/andrezgz/perl5/ch-2.pl73
-rw-r--r--challenge-032/dave-cross/perl5/ch-2.pl1
-rwxr-xr-xchallenge-032/e-choroba/perl5/ch-1.pl26
-rwxr-xr-xchallenge-032/e-choroba/perl5/ch-1.sh2
-rwxr-xr-xchallenge-032/e-choroba/perl5/ch-2.pl64
-rw-r--r--challenge-032/lars-balker/perl5/ch-1.pl22
-rw-r--r--challenge-032/lars-balker/perl5/ch-2.pl28
-rwxr-xr-xchallenge-032/lars-thegler/perl5/ch-1.pl41
-rwxr-xr-xchallenge-032/lars-thegler/perl5/ch-2.pl50
-rw-r--r--challenge-032/markus-holzer/perl6/ch-1-and-2.pl626
-rw-r--r--challenge-032/markus-holzer/perl6/ch-1.p626
-rw-r--r--challenge-032/markus-holzer/perl6/ch-2.p626
-rw-r--r--challenge-032/markus-holzer/perl6/simpsons.txt10
-rw-r--r--challenge-032/markus-holzer/perl6/test.bat6
-rw-r--r--challenge-032/simon-proctor/perl6/ch-2.p67
-rw-r--r--challenge-032/steven-wilson/perl5/ch-1.pl53
-rw-r--r--challenge-032/yet-ebreo/perl5/ch-1.pl115
-rw-r--r--challenge-032/yet-ebreo/perl5/ch-2.pl51
-rw-r--r--challenge-032/yet-ebreo/perl5/sample.txt17
-rw-r--r--stats/pwc-current.json205
-rw-r--r--stats/pwc-language-breakdown-summary.json54
-rw-r--r--stats/pwc-language-breakdown.json522
-rw-r--r--stats/pwc-leaders.json592
-rw-r--r--stats/pwc-summary-1-30.json46
-rw-r--r--stats/pwc-summary-121-150.json28
-rw-r--r--stats/pwc-summary-31-60.json100
-rw-r--r--stats/pwc-summary-61-90.json120
-rw-r--r--stats/pwc-summary-91-120.json118
-rw-r--r--stats/pwc-summary.json54
30 files changed, 1681 insertions, 869 deletions
diff --git a/challenge-032/andrezgz/perl5/ch-1.pl b/challenge-032/andrezgz/perl5/ch-1.pl
new file mode 100644
index 0000000000..4d63fc361c
--- /dev/null
+++ b/challenge-032/andrezgz/perl5/ch-1.pl
@@ -0,0 +1,67 @@
+#!/usr/bin/perl
+
+# https://perlweeklychallenge.org/blog/perl-weekly-challenge-032/
+# Task #1
+# Count instances
+# Create a script that either reads standard input or one or more files specified on the command-line.
+# Count the number of times and then print a summary, sorted by the count of each entry.
+# So with the following input in file example.txt
+# apple
+# banana
+# apple
+# cherry
+# cherry
+# apple
+# the script would display something like:
+# apple 3
+# cherry 2
+# banana 1
+# For extra credit, add a -csv option to your script, which would generate:
+# apple,3
+# cherry,2
+# banana,1
+
+use strict;
+use warnings;
+
+my $csv = @ARGV && $ARGV[0] eq '-csv' ? 1 : 0;
+shift @ARGV if $csv;
+
+print "Ctrl + D to finish\n" unless @ARGV; # when entering input from STDIN
+
+my %entries;
+chomp, $entries{$_}++ while (<>); # count instances
+
+print "Instances count:\n";
+print join "\n", # Print a line
+ map { sprintf '%s%s%d', # composed by
+ $_, # the entry name,
+ $csv ? ',' : "\t", # the separator (comma or tab),
+ $entries{$_} # and the number of instances
+ }
+ reverse sort { $entries{$a} <=> $entries{$b} } # from the sorted by number of instances (desc)
+ keys %entries; # entry list
+
+print "\n";
+
+__END__
+ ./ch-1.pl
+Ctrl + D to finish
+apple
+cherry
+apple
+Instances count:
+apple 2
+cherry 1
+
+./ch-1.pl w1.txt
+Instances count:
+apple 3
+cherry 2
+banana 1
+
+./ch-1.pl -csv example.txt
+Instances count:
+apple,3
+cherry,2
+banana,1
diff --git a/challenge-032/andrezgz/perl5/ch-2.pl b/challenge-032/andrezgz/perl5/ch-2.pl
new file mode 100644
index 0000000000..cecd15ab99
--- /dev/null
+++ b/challenge-032/andrezgz/perl5/ch-2.pl
@@ -0,0 +1,73 @@
+#!/usr/bin/perl
+
+# https://perlweeklychallenge.org/blog/perl-weekly-challenge-032/
+# Task #2
+# ASCII bar chart
+# Write a function that takes a hashref where the keys are labels
+# and the values are integer or floating point values.
+# Generate a bar graph of the data and display it to stdout.
+# The input could be something like:
+#
+# $data = { apple => 3, cherry => 2, banana => 1 };
+# generate_bar_graph($data);
+# And would then generate something like this:
+#
+# apple | ############
+# cherry | ########
+# banana | ####
+# If you fancy then please try this as well:
+# (a) the function could let you specify whether the chart
+# should be ordered by (1) the labels, or (2) the values.
+
+use strict;
+use warnings;
+
+use List::Util qw/max/;
+
+my $source = { apple => 3, cherry => 2, banana => 1, orange => 2.5 };
+
+print "Sorted by name\n";
+generate_bar_graph($source,{sort => 'labels' });
+
+print "Sorted by value\n";
+generate_bar_graph($source,{sort => 'values' });
+
+sub generate_bar_graph {
+ my $data = shift;
+ my $args = shift;
+
+ my @sorted_keys = keys %$data;
+ if ($args->{sort} eq 'values') {
+ # keys sorted by values (desc)
+ @sorted_keys = reverse sort { $data->{$a} <=> $data->{$b} } @sorted_keys;
+ }
+ else{
+ # keys sorted (asc)
+ @sorted_keys = sort @sorted_keys;
+ }
+
+ my $inc = 50 / max (values %$data); # percentage increment
+ print join "\n",
+ map { sprintf '%-10s| %s',
+ $_,
+ '#' x ($data->{$_} * $inc)
+ }
+ @sorted_keys;
+
+ print "\n";
+ return;
+}
+
+__END__
+
+./ch-2.pl
+Sorted by name
+apple | ##################################################
+banana | ################
+cherry | #################################
+orange | #########################################
+Sorted by value
+apple | ##################################################
+orange | #########################################
+cherry | #################################
+banana | ################
diff --git a/challenge-032/dave-cross/perl5/ch-2.pl b/challenge-032/dave-cross/perl5/ch-2.pl
index 37fbda8759..5c786b2721 100644
--- a/challenge-032/dave-cross/perl5/ch-2.pl
+++ b/challenge-032/dave-cross/perl5/ch-2.pl
@@ -27,7 +27,6 @@ sub text_bar {
}
my ($width) = GetTerminalSize;
- say $width;
my $keylen = max map { length } keys %$data;
my $maxval = max values %$data;
diff --git a/challenge-032/e-choroba/perl5/ch-1.pl b/challenge-032/e-choroba/perl5/ch-1.pl
new file mode 100755
index 0000000000..4fbaef2346
--- /dev/null
+++ b/challenge-032/e-choroba/perl5/ch-1.pl
@@ -0,0 +1,26 @@
+#! /usr/bin/perl
+use warnings;
+use strict;
+
+use Getopt::Long;
+use Text::CSV_XS qw{ csv };
+use List::Util qw{ max };
+
+use open IO => ':encoding(UTF-8)', ':std';
+
+GetOptions(csv => \ my $csv_output);
+
+my %count;
+chomp, ++$count{$_} while <>;
+
+if ($csv_output) {
+ csv(in => [
+ map [$_, $count{$_} ],
+ sort { $count{$b} <=> $count{$a} }
+ keys %count]);
+
+} else {
+ my $max_length = max(map length, keys %count);
+ printf "%${max_length}s %d\n", $_, $count{$_}
+ for sort { $count{$a} <=> $count{$b} } keys %count;
+}
diff --git a/challenge-032/e-choroba/perl5/ch-1.sh b/challenge-032/e-choroba/perl5/ch-1.sh
new file mode 100755
index 0000000000..2f88949be9
--- /dev/null
+++ b/challenge-032/e-choroba/perl5/ch-1.sh
@@ -0,0 +1,2 @@
+#! /bin/bash
+cat "$@" | sort | uniq -c | sort -nr
diff --git a/challenge-032/e-choroba/perl5/ch-2.pl b/challenge-032/e-choroba/perl5/ch-2.pl
new file mode 100755
index 0000000000..752d3dc050
--- /dev/null
+++ b/challenge-032/e-choroba/perl5/ch-2.pl
@@ -0,0 +1,64 @@
+#! /usr/bin/perl
+{ package My::BarChart;
+ use Moo;
+
+ use Function::Parameters;
+ use Types::Standard qw{ HashRef Num Str Enum };
+ use List::Util qw{ max };
+
+ sub SortBy { Enum[qw[ labels values labels_desc values_desc ]] }
+
+ use namespace::clean;
+
+ has width => (is => 'lazy', isa => Num);
+ has data => (is => 'ro', isa => HashRef[Num], required => 1);
+ has separator => (is => 'ro', isa => Str, default => ' | ');
+
+ has _bar_width => (is => 'lazy', isa => Num);
+ has _max_length => (is => 'lazy', isa => Num);
+
+ method generate (SortBy $sort_by = 'keys') {
+ my $data = $self->data;
+ my $max = max(values %$data);
+
+ my $sort = {labels => \&_by_key,
+ values => \&_by_value,
+ labels_desc => \&_by_key_desc,
+ values_desc => \&_by_value_desc}->{$sort_by};
+
+ for my $key (sort { $self->$sort } keys %$data) {
+ printf '%' . $self->_max_length . "s%s%s\n",
+ $key,
+ $self->separator,
+ '#' x ($self->_bar_width / $max * $data->{$key});
+ }
+ }
+
+ method BUILD ($) {
+ die "Chart is too wide.\n" if $self->_bar_width <= 0;
+ }
+
+ method _build_width () { $ENV{COLUMNS} || qx{tput cols} || 80 }
+
+ method _build__max_length () { max(map length, keys %{ $self->data }) }
+
+ method _build__bar_width () {
+ $self->width - $self->_max_length - length $self->separator
+ }
+
+ method _by_key () { $a cmp $b }
+ method _by_key_desc () { $b cmp $a }
+ method _by_value () { $self->data->{$a} <=> $self->data->{$b} }
+ method _by_value_desc () { $self->data->{$b} <=> $self->data->{$a} }
+}
+
+use warnings;
+use strict;
+use feature qw{ say };
+
+my $data = { apple => 3, cherry => 2, banana => .5 };
+my $chart = 'My::BarChart'->new(data => $data);
+
+say $chart->generate('labels');
+say $chart->generate('values');
+say $chart->generate('values_desc');
diff --git a/challenge-032/lars-balker/perl5/ch-1.pl b/challenge-032/lars-balker/perl5/ch-1.pl
new file mode 100644
index 0000000000..32bc6524ec
--- /dev/null
+++ b/challenge-032/lars-balker/perl5/ch-1.pl
@@ -0,0 +1,22 @@
+use warnings;
+use strict;
+
+my $csv = @ARGV && $ARGV[0] eq '-csv';
+shift if $csv;
+
+my %words;
+my $maxlength = 0;
+while (<>) {
+ chomp;
+ ++$words{$_};
+ $maxlength = length if length > $maxlength;
+}
+
+for my $word (sort { $words{$b} <=> $words{$a} || $a cmp $b } keys %words) {
+ if ($csv) {
+ printf "%s,%d\n", $word, $words{$word};
+ }
+ else {
+ printf "%-*s %4d\n", $maxlength, $word, $words{$word};
+ }
+}
diff --git a/challenge-032/lars-balker/perl5/ch-2.pl b/challenge-032/lars-balker/perl5/ch-2.pl
new file mode 100644
index 0000000000..81e9b616f3
--- /dev/null
+++ b/challenge-032/lars-balker/perl5/ch-2.pl
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+my $hashes = 24;
+
+my $data = { apple => 3, cherry => 2, banana => 1 };
+generate_bar_graph($data);
+print "\n";
+generate_bar_graph($data,1);
+
+sub generate_bar_graph {
+ my $data = shift;
+ my $order_by_label = shift;
+
+ my ($sum, $maxlength) = (0, 0);
+ for my $word (keys %$data) {
+ $maxlength = length($word) if length($word) > $maxlength;
+ $sum += $data->{$word};
+ }
+
+ my $sort = $order_by_label
+ ? sub { $a cmp $b }
+ : sub { $data->{$b} <=> $data->{$a} || $a cmp $b };
+ for my $word (sort $sort keys %$data) {
+ my $pct = $data->{$word} / $sum;
+ printf "%*s | %s\n", $maxlength, $word,
+ "#" x int($hashes * $pct);
+ }
+}
diff --git a/challenge-032/lars-thegler/perl5/ch-1.pl b/challenge-032/lars-thegler/perl5/ch-1.pl
new file mode 100755
index 0000000000..57d9fc59ea
--- /dev/null
+++ b/challenge-032/lars-thegler/perl5/ch-1.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/env perl
+
+use Modern::Perl;
+
+# Task #1
+# Contributed by Neil Bowers
+# Count instances
+# Create a script that either reads standard input or one or more files specified on the command-line. Count the number of times and then print a summary, sorted by the count of each entry.
+
+# So with the following input in file example.txt
+
+# apple
+# banana
+# apple
+# cherry
+# cherry
+# apple
+# the script would display something like:
+
+# apple 3
+# cherry 2
+# banana 1
+# For extra credit, add a -csv option to your script, which would generate:
+
+# apple,3
+# cherry,2
+# banana,1
+
+use Getopt::Long;
+GetOptions("csv" => \my $csv) or die;
+
+my %count;
+while (<>) {
+ chomp;
+ $count{$_}++;
+}
+
+my $delim = $csv ? ',' : "\t";
+for my $k (sort keys %count) {
+ say "$k$delim$count{$k}";
+} \ No newline at end of file
diff --git a/challenge-032/lars-thegler/perl5/ch-2.pl b/challenge-032/lars-thegler/perl5/ch-2.pl
new file mode 100755
index 0000000000..c39d891648
--- /dev/null
+++ b/challenge-032/lars-thegler/perl5/ch-2.pl
@@ -0,0 +1,50 @@
+#!/usr/bin/env perl
+
+use Modern::Perl;
+
+# Task #2
+# Contributed by Neil Bowers
+# ASCII bar chart
+
+# Write a function that takes a hashref where the keys are labels and the values are integer or floating point values. Generate a bar graph of the data and display it to stdout.
+
+# The input could be something like:
+
+# $data = { apple => 3, cherry => 2, banana => 1 };
+# generate_bar_graph($data);
+# And would then generate something like this:
+
+# apple | ############
+# cherry | ########
+# banana | ####
+# If you fancy then please try this as well: (a) the function could let you specify whether the chart should be ordered by (1) the labels, or (2) the values.
+
+use List::Util 'max';
+use Getopt::Long;
+GetOptions( "val" => \my $order_by_values ) or die;
+
+my $data = { apple => 3, cherry => 2, banana => 1 };
+
+say generate_bar_graph( $data, $order_by_values );
+
+sub generate_bar_graph
+{
+ my $data = shift;
+ my $order_by_values = shift // 0;
+ my $max_bar_length = 12; # length of the longest bar
+
+ # determine highest value
+ my $max_value = max values $data->%*;
+
+ # determine longest label
+ my $max_length = max map { length $_ } keys $data->%*;
+
+ my $graph;
+ for my $label ( sort { $order_by_values ? $data->{$b} <=> $data->{$a} : $a cmp $b } keys $data->%* ) {
+ my $value = $data->{$label};
+ my $bar_length = int( $value / $max_value * $max_bar_length );
+ $graph .= sprintf "%*s | %s\n", $max_length, $label, '#' x $bar_length;
+ }
+
+ return $graph;
+}
diff --git a/challenge-032/markus-holzer/perl6/ch-1-and-2.pl6 b/challenge-032/markus-holzer/perl6/ch-1-and-2.pl6
new file mode 100644
index 0000000000..f1eb4d25dc
--- /dev/null
+++ b/challenge-032/markus-holzer/perl6/ch-1-and-2.pl6
@@ -0,0 +1,26 @@
+my %*SUB-MAIN-OPTS = :named-anywhere;
+
+multi sub MAIN( *@files, Bool :$csv, Bool :$graph, Bool :$sort-by-label )
+{
+ CATCH { return .message.say }
+
+ my @words = @files
+ ?? @files.map( |*.IO.lines )
+ !! |$*ARGFILES.lines;
+
+ my $weights = Bag.new( @words );
+ my $lngst = max $weights.keys.map( *.chars );
+
+ my $format = $csv ?? "%s, %s" !!
+ $graph ?? "%{$lngst}s | %s " !!
+ "%-{$lngst}s %s " ;
+
+ my &sorter = $sort-by-label
+ ?? { $^a.key cmp $^b.key }
+ !! { $^b.value <=> $^a.value };
+
+ .say for $weights
+ .sort( &sorter )
+ .map({ .key => $graph ?? "#" x .value !! .value })
+ .map({ sprintf $format, .key, .value });
+} \ No newline at end of file
diff --git a/challenge-032/markus-holzer/perl6/ch-1.p6 b/challenge-032/markus-holzer/perl6/ch-1.p6
new file mode 100644
index 0000000000..f1eb4d25dc
--- /dev/null
+++ b/challenge-032/markus-holzer/perl6/ch-1.p6
@@ -0,0 +1,26 @@
+my %*SUB-MAIN-OPTS = :named-anywhere;
+
+multi sub MAIN( *@files, Bool :$csv, Bool :$graph, Bool :$sort-by-label )
+{
+ CATCH { return .message.say }
+
+ my @words = @files
+ ?? @files.map( |*.IO.lines )
+ !! |$*ARGFILES.lines;
+
+ my $weights = Bag.new( @words );
+ my $lngst = max $weights.keys.map( *.chars );
+
+ my $format = $csv ?? "%s, %s" !!
+ $graph ?? "%{$lngst}s | %s " !!
+ "%-{$lngst}s %s " ;
+
+ my &sorter = $sort-by-label
+ ?? { $^a.key cmp $^b.key }
+ !! { $^b.value <=> $^a.value };
+
+ .say for $weights
+ .sort( &sorter )
+ .map({ .key => $graph ?? "#" x .value !! .value })
+ .map({ sprintf $format, .key, .value });
+} \ No newline at end of file
diff --git a/challenge-032/markus-holzer/perl6/ch-2.p6 b/challenge-032/markus-holzer/perl6/ch-2.p6
new file mode 100644
index 0000000000..f1eb4d25dc
--- /dev/null
+++ b/challenge-032/markus-holzer/perl6/ch-2.p6
@@ -0,0 +1,26 @@
+my %*SUB-MAIN-OPTS = :named-anywhere;
+
+multi sub MAIN( *@files, Bool :$csv, Bool :$graph, Bool :$sort-by-label )
+{
+ CATCH { return .message.say }
+
+ my @words = @files
+ ?? @files.map( |*.IO.lines )
+ !! |$*ARGFILES.lines;
+
+ my $weights = Bag.new( @words );
+ my $lngst = max $weights.keys.map( *.chars );
+
+ my $format = $csv ?? "%s, %s" !!
+ $graph ?? "%{$lngst}s | %s " !!
+ "%-{$lngst}s %s " ;
+
+ my &sorter = $sort-by-label
+ ?? { $^a.key cmp $^b.key }
+ !! { $^b.value <=> $^a.value };
+
+ .say for $weights
+ .sort( &sorter )
+ .map({ .key => $graph ?? "#" x .value !! .value })
+ .map({ sprintf $format, .key, .value });
+} \ No newline at end of file
diff --git a/challenge-032/markus-holzer/perl6/simpsons.txt b/challenge-032/markus-holzer/perl6/simpsons.txt
new file mode 100644
index 0000000000..fafebd89f4
--- /dev/null
+++ b/challenge-032/markus-holzer/perl6/simpsons.txt
@@ -0,0 +1,10 @@
+Bart
+Bart
+Maggie
+Marge
+Homer
+Bart
+Homer
+Bart
+Marge
+Marge \ No newline at end of file
diff --git a/challenge-032/markus-holzer/perl6/test.bat b/challenge-032/markus-holzer/perl6/test.bat
new file mode 100644
index 0000000000..8da2aff480
--- /dev/null
+++ b/challenge-032/markus-holzer/perl6/test.bat
@@ -0,0 +1,6 @@
+@echo off
+type simpsons.txt|call perl6 ch-1-and-2.pl6
+type simpsons.txt|call perl6 ch-1-and-2.pl6 --csv
+call perl6 ch-1-and-2.pl6 simpsons.txt simpsons.txt
+call perl6 ch-1-and-2.pl6 simpsons.txt --graph
+call perl6 ch-1-and-2.pl6 --csv simpsons.txt --sort-by-label
diff --git a/challenge-032/simon-proctor/perl6/ch-2.p6 b/challenge-032/simon-proctor/perl6/ch-2.p6
index 6e497adf27..0022fd7e2b 100644
--- a/challenge-032/simon-proctor/perl6/ch-2.p6
+++ b/challenge-032/simon-proctor/perl6/ch-2.p6
@@ -66,7 +66,12 @@ sub get-bar( Int $available, $max, $value ) {
}
sub get-screen-width() {
- run("tput","cols",:out).out.slurp.chomp;
+ my $result;
+ try {
+ $result = run("tput","cols",:out).out.slurp.chomp;
+ }
+ # Fallback incase tput not available
+ return $result || 100;
}
sub parse-space-sep( Str $line ) {
diff --git a/challenge-032/steven-wilson/perl5/ch-1.pl b/challenge-032/steven-wilson/perl5/ch-1.pl
new file mode 100644
index 0000000000..99b1e44d31
--- /dev/null
+++ b/challenge-032/steven-wilson/perl5/ch-1.pl
@@ -0,0 +1,53 @@
+#!/usr/bin/env perl
+# Author: Steven Wilson
+# Date: 2019-10-28
+# Week: 032
+
+# Task #1
+
+# Count instances
+# Create a script that either reads standard input or one or more files
+# specified on the command-line. Count the number of times and then
+# print a summary, sorted by the count of each entry.
+# So with the following input in file example.txt
+# apple
+# banana
+# apple
+# cherry
+# cherry
+# apple
+# the script would display something like:
+# apple 3
+# cherry 2
+# banana 1
+# For extra credit, add a -csv option to your script, which would generate:
+# apple,3
+# cherry,2
+# banana,1
+
+use strict;
+use warnings;
+use feature qw/ say /;
+
+my %word_count;
+my $delimiter = "\t";
+if ( $ARGV[0] eq "-csv" ) {
+ shift @ARGV;
+ $delimiter = ",";
+}
+
+for my $file (@ARGV) {
+ open my $fh, '<', $file or die "Can't open < $file: $!";
+ while ( !eof $fh ) {
+ my $word = readline $fh;
+ chomp $word;
+ $word_count{$word} += 1;
+ }
+}
+
+my @word_count_desc
+ = reverse sort { $word_count{$a} <=> $word_count{$b} } keys %word_count;
+
+for my $word (@word_count_desc) {
+ say "$word$delimiter$word_count{$word}";
+}
diff --git a/challenge-032/yet-ebreo/perl5/ch-1.pl b/challenge-032/yet-ebreo/perl5/ch-1.pl
new file mode 100644
index 0000000000..33edba3f0d
--- /dev/null
+++ b/challenge-032/yet-ebreo/perl5/ch-1.pl
@@ -0,0 +1,115 @@
+#!/usr/bin/perl
+# Create a script that either reads standard input or one or more
+# files specified on the command-line. Count the number of times
+# and then print a summary, sorted by the count of each entry.
+# So with the following input in file example.txt
+# apple
+# banana
+# apple
+# cherry
+# cherry
+# apple
+# the script would display something like:
+# apple 3
+# cherry 2
+# banana 1
+# For extra credit, add a -csv option to your script, which would generate:
+# apple,3
+# cherry,2
+# banana,1
+use strict;
+use warnings;
+use feature 'say';
+
+my @files;
+my $csv_flag = 0;
+my $longest = 0;
+for my $arg (@ARGV) {
+ if ($arg eq '-csv') {
+ $csv_flag = 1;
+ } else {
+ push @files, $arg;
+ }
+}
+
+my %dictionary;
+if (@ARGV < ($csv_flag+1)) {
+ say "Type the word(s) then press enter, :end to quit:";
+ while (chomp(my $word = <STDIN>)) {
+ ($word =~ /^:end$/) && last;
+ $longest = length $word if $longest < length $word;
+ $dictionary{$word}++;
+ }
+} else {
+ for my $text (@files) {
+ open my $handle, '<', $text;
+ chomp(my @lines = <$handle>);
+ close $handle;
+
+ for my $word (@lines) {
+ $longest = length $word if $longest < length $word;
+ $dictionary{$word}++;
+ }
+ }
+}
+
+$longest = 0 if $csv_flag;
+
+for my $keys (sort { $dictionary{$b}-$dictionary{$a} } sort keys %dictionary) {
+ printf ("%-${longest}s%s%s\n",$keys,$csv_flag?",":" ",$dictionary{$keys});
+}
+=begin
+perl .\ch-1.pl
+Type the word(s) then press enter, :end to quit:
+a
+quick
+brown
+apple
+jumps
+over
+dog
+brown
+cat
+apple
+:end
+apple 2
+brown 2
+a 1
+cat 1
+dog 1
+jumps 1
+over 1
+quick 1
+
+perl .\ch-1.pl .\sample.txt
+apple 2
+brown 2
+dog 2
+a 1
+banana 1
+black 1
+cat 1
+fox 1
+jumps 1
+lazy 1
+over 1
+quick 1
+test 1
+the 1
+
+perl .\ch-1.pl -csv .\sample.txt
+apple,2
+brown,2
+dog,2
+a,1
+banana,1
+black,1
+cat,1
+fox,1
+jumps,1
+lazy,1
+over,1
+quick,1
+test,1
+the,1
+=cut \ No newline at end of file
diff --git a/challenge-032/yet-ebreo/perl5/ch-2.pl b/challenge-032/yet-ebreo/perl5/ch-2.pl
new file mode 100644
index 0000000000..2a5c12aff6
--- /dev/null
+++ b/challenge-032/yet-ebreo/perl5/ch-2.pl
@@ -0,0 +1,51 @@
+#!/usr/bin/perl
+# Write a function that takes a hashref where the keys are labels
+# and the values are integer or floating point values.
+# Generate a bar graph of the data and display it to stdout.
+
+# The input could be something like:
+
+# $data = { apple => 3, cherry => 2, banana => 1 };
+# generate_bar_graph($data);
+# And would then generate something like this:
+
+# apple | ############
+# cherry | ########
+# banana | ####
+# If you fancy then please try this as well: (a) the function could let you specify whether the chart should be ordered by (1) the labels, or (2) the values.
+use strict;
+use warnings;
+use feature 'say';
+sub generate_bar_graph {
+ my @keys;
+ my ($data,$opt) = @_;
+ my $longest = 0;
+ my @sorted = sort keys %{$data};
+ for my $word (@sorted) {
+ $longest = length $word if $longest < length $word;
+ }
+
+ @keys = ($opt eq "values")?sort { ${$data}{$b}-${$data}{$a} } @sorted:@sorted;
+
+ for my $word (@keys) {
+ printf ("%${longest}s | %s\n",$word, "####" x ${$data}{$word});
+ }
+}
+
+my $data = { apple => 3, cherry => 2, banana => 1 };
+say "Bar graph sorted by labels:";
+generate_bar_graph($data,"labels");
+say "\nBar graph sorted by values:";
+generate_bar_graph($data,"values");
+=begin
+perl .\ch-2.pl
+Bar graph sorted by labels:
+ apple | ############
+banana | ####
+cherry | ########
+
+Bar graph sorted by values:
+ apple | ############
+cherry | ########
+banana | ####
+=cut \ No newline at end of file
diff --git a/challenge-032/yet-ebreo/perl5/sample.txt b/challenge-032/yet-ebreo/perl5/sample.txt
new file mode 100644
index 0000000000..b702ef5428
--- /dev/null
+++ b/challenge-032/yet-ebreo/perl5/sample.txt
@@ -0,0 +1,17 @@
+a
+quick
+brown
+fox
+jumps
+over
+the
+lazy
+dog
+test
+apple
+banana
+black
+brown
+apple
+dog
+cat \ No newline at end of file
diff --git a/stats/pwc-current.json b/stats/pwc-current.json
index 13cf2f3a67..09a85ed191 100644
--- a/stats/pwc-current.json
+++ b/stats/pwc-current.json
@@ -1,78 +1,183 @@
{
- "chart" : {
- "type" : "column"
+ "subtitle" : {
+ "text" : "[Champions: 9] Last updated at 2019-10-29 14:15:57 GMT"
},
- "yAxis" : {
- "title" : {
- "text" : "Total Solutions"
+ "legend" : {
+ "enabled" : 0
+ },
+ "xAxis" : {
+ "type" : "category"
+ },
+ "tooltip" : {