aboutsummaryrefslogtreecommitdiff
path: root/challenge-037/jo-37
diff options
context:
space:
mode:
authorJörg Sommrey <28217714+jo-37@users.noreply.github.com>2023-03-27 10:39:05 +0200
committerJörg Sommrey <28217714+jo-37@users.noreply.github.com>2023-04-19 17:15:35 +0200
commit570d93fd5c566075161b7d0627893eec68dc1d38 (patch)
tree6cf9066b30a669d8eb53352b4271478ad42e8a25 /challenge-037/jo-37
parent3fec24b48245cef9ed4b99cc6d81703c40c16141 (diff)
downloadperlweeklychallenge-club-570d93fd5c566075161b7d0627893eec68dc1d38.tar.gz
perlweeklychallenge-club-570d93fd5c566075161b7d0627893eec68dc1d38.tar.bz2
perlweeklychallenge-club-570d93fd5c566075161b7d0627893eec68dc1d38.zip
Challenge 037 task 1
Diffstat (limited to 'challenge-037/jo-37')
-rwxr-xr-xchallenge-037/jo-37/perl/ch-1.pl14
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-037/jo-37/perl/ch-1.pl b/challenge-037/jo-37/perl/ch-1.pl
new file mode 100755
index 0000000000..c66df1b759
--- /dev/null
+++ b/challenge-037/jo-37/perl/ch-1.pl
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+
+use v5.16;
+use warnings;
+use Date::Manip::Recur;
+use List::MoreUtils 'part';
+
+
+# Pick all Mondays to Fridays in 2019, distribute by month and print
+# month name and workday count.
+say $_->[0]->printf("%b"), ": ", scalar @$_ for
+part {$_->printf("%f") - 1}
+Date::Manip::Recur->new("0:0:0*1-5:0:0:0", undef, 2019, "2019-12-31")->dates;
+