in reply to Re^2: Doomsday algorithm
in thread Doomsday algorithm

Yes, that's what I meant with "more elegant solution". The next step would be to further "normalize" that $nbdays such that Sunday is the usual 0 or 7 (like in strftime %u or %w) by calculating
my $nbdays = ($diff_to_doomsdates + $year_anchor_day + 2) % 7; # or -5