in reply to
Setting up date to subtract specific number from it
Well, if you just search for “date” at http://search.cpan.org, you will today get 5000 hits ...
Some suggestions of packages that I have used very often:
DateTime will do absolutely anything with a date. Takes a bit of time to grok its examples, but once you do, it’s worth it.
Date::Manip is another object-oriented interface for dates. Again, there is a learning curve.
Date::Simple ... well, it’s simple. Put down your Swiss Army® knife and grab this pocket-knife which happens to have the blades you use most often.
But there are literally thousands more, including some pure-fun ones. Search as-above for “DateTime Calendar” and then get your time-machine ready: DateTime::Calendar::Mayan, DateTime::Calendar::FrenchRevolutionary,
The one thing you don’t have to do in Perl is to “write your own” routines to handle positively anything that has to do with dates/times. I find it very convenient to use the packages which define a date-time object, i.e. “this thing ‘is a’ date/time, its internal implementation is blissfully opaque, and I can tell it to do things and ask it questions and It Just Works.™” Functional interfaces are much more baroque due to the sheer number of options that must be supported by a thorough handling of dates.