http://qs321.pair.com?node_id=11147734


in reply to Re^5: Choosing the right module (Acme::EyeDrops used in production)
in thread Choosing the right module

Nice.

Acme modules aren't always completely useless. I sometimes use Acme::September::Eternal and Acme::December::Eternal as examples on how to do date calculations using Date::Manip

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

Replies are listed 'Best First'.
Re^7: Choosing the right module
by hippo (Bishop) on Oct 27, 2022 at 11:11 UTC

    I was unaware of Acme::September::Eternal until today. A couple of years ago in my ignorance I wrote a little script to perform essentially the same task, albeit just for the current date.

    Looking into the source we can see that Acme::September::Eternal makes use of Date::Manip (as you mention) and Lingua::EN::Numbers::Ordinate whereas my solution is based on Time::Piece and Lingua::EN::Inflexion. Mechanical details aside, they are practically the same. TIMTOWTDI indeed.

    Here is a redacted version of mine, for anyone interested.

    #!/usr/bin/env perl use strict; use warnings; use Time::Piece; use Lingua::EN::Inflexion 'inflect'; my $now = localtime; my $then = Time::Piece->strptime ('1993-08-31', '%Y-%m-%d'); my $diff = $now - $then; $diff = int ($diff / 86400); my $day = inflect ("<#o:$diff>"); print "Today is the $day of September 1993\n"; exit;

    🦛