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


in reply to How to calculate if today is before May 1

For "today":

shmem [qwurx] ~> perl -MDate::Parse -E 'say+(str2time("$_-05-01") >= t +ime ? "before" : "after"). " $_-05-01" for qw(2019 2020)' after 2019-05-01 before 2020-05-01 shmem [qwurx] ~>

Invoking that on 2020-05-01 will give you "after 2020-05-01". For distinguishig "before", "at" and "after" a simple ternary '? :' construct isn't enough.

For TODAY as a date in any year, just construct the input for st2time() and the TODAY epoch timestamp (use that instead of time above) according to the format of TODAY.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'