I want to see you get the lookup right for all edge cases.
Date::Manip is a fine choice if, as the author himself says, you want to allow users to specify dates in fairly freeform, descriptive fashion.
But other than that, I'd avoid it. It doesn't even make for particularly readable code. The only thing that's intuitive about your snippet is DateCalc()'s offset format. The output format string isn't self-documenting and the implicit truncation is not obvious. I had to read your explanation to know what it does.
Try this on for size:
use DateTime; my $date = DateTime ->now ->truncate( to => 'month' ) ->add( months => 1, days => -1 ); print $date->day;
DateTime rocks.
Makeshifts last the longest.
In reply to Re^4: Finding End of Month's date
by Aristotle
in thread Finding End of Month's date
by neeraj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |