aboutsummaryrefslogtreecommitdiff
path: root/challenge-019/prajith-p/perl5/ch-1.pl
blob: ff01fdd2eb7023c12107385a883fce923ea89606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/opt/deployer/embedded/bin/perl -w

use strict;
use warnings;

use DateTime;
use feature qw<say>;

for my $year (1900..2019) {
    for my $month ( 1 , 3 , 5 , 7 , 8 , 10 , 12 )  {
        my $dt = DateTime->new( year => $year , month => $month, day => 1);
        if ( $dt->day_of_week == 5 ) {
            say $dt->year . ' - ' . $dt->month_name;
        }
    }
}