|
|
| P is for Practical | |
| PerlMonks |
Re: How to find the last date of the previous month?by tobyink (Prior) |
| on Oct 30, 2012 at 08:11 UTC ( #1001468=note: print w/ replies, xml ) | Need Help?? |
|
In the spirit of TIMTOWTDI, here's an example using Time::Piece. The advantage of using Time::Piece is that as of Perl 5.10, it's bundled with Perl core. (As is its companion module Time::Seconds.)
The daylight savings calculation is a bit of an annoyance. :-( Yeah, that's right; I just did maths with the spaceship operator! :-)
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||