Quote:
Originally Posted by
nomkev
i was using:
...
in gawk. is there a way without using date::calc?
I'd assume that date is a datatype in gawk, which allows you to perform simple date arithmetic like "date + 3" or "date - 3". As far as I know, date is not a datatype in Perl.
Of course, there is a way without using date::calc. And that is - implementing that logic by yourself, say, in a module. So the module would take care of things like changes in months, years, leap years, non-leap years (also the ones divisible by 100 but not 400) etc. Personally, I think that is too much work; and if someone else has done that work and tested it, then I don't see why I cannot use the module (Date::Calc etc.). The very reason they write modules is so others don't reinvent the wheel.
Yet another thought is - if your underlying shell allows you to perform date arithmetic, then you could invoke those commands using the "system" function. But then that's a shell script and not a perl program in the strictest sense.
tyler_durden