aboutsummaryrefslogtreecommitdiff
path: root/challenge-227/avery-adams/perl/ch-1.pl
blob: 09cdcd59245ab1f1d9729e97c12051d24ffc8ba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl

use v5.36;
use DateTime;

my $year = shift;
my $fridays;

foreach (1..12) {
    my $dt = DateTime->new('year' => $year, 'month' => $_, 'day' => 13);
    $fridays++ if $dt->day_of_week == 5;
}
say $fridays;