Skip to content

Instantly share code, notes, and snippets.

@jacoby
Created February 14, 2024 20:36
Show Gist options
  • Save jacoby/b2d44f6025ecd611cc1fab11ca789cbc to your computer and use it in GitHub Desktop.
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
#!/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