in reply to Good & Easy Date Module?
Inflexible example non-module solution, which I'm not really recommending: second Thursday every month ... Must be (a) Thursday, (b) at least the 8th, and (c) no later than the 15th (is that even right? I think so, but you use a module to let someone else worry about such things)
sub second_thursday { my ($dow, $dom) = (split " ", scalar localtime)[0,2]; ($dow eq "Thu" && $dom > 7 && $dom < 16 ) ? 1 : 0; }
( note: altered from its original form, to be plus élégant =) )
And you'll have to do something like that for the others, too. scalar localtime produces some pretty useful stuff, but there are all sorts of tricks n' traps (like, I'm not sure whether splitting on a single space works when the day of the month is < 10 ...)
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
|
|---|