Created
February 14, 2024 20:36
-
-
Save jacoby/b2d44f6025ecd611cc1fab11ca789cbc to your computer and use it in GitHub Desktop.
Perl program to show when Ash Wednesday falls on St. Valentine's Day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use experimental qw{say}; | |
use DateTime; | |
use DateTime::Event::Easter; | |
my $val_day = 14; | |
my $val_mon = 2; | |
my $api = DateTime::Event::Easter->new(day=>'Ash Wednesday'); | |
for my $y ( 1800 .. 2050 ) { | |
my $date = DateTime->new( year => $y, month => 1, day => 1 ); | |
my $ash_wed = $api->following($date); | |
next unless $val_mon == $ash_wed->month; | |
next unless $val_day == $ash_wed->day; | |
say join "\t", $ash_wed->year; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment