I think you're working at that too hard:
use Date::Manip;
print map UnixDate($_, "%g\n"), ParseRecur("first monday of every mont
+h in 2001");
which yields
Mon, 01 Jan 2001 00:00:00 -0800
Mon, 05 Feb 2001 00:00:00 -0800
Mon, 05 Mar 2001 00:00:00 -0800
Mon, 02 Apr 2001 00:00:00 -0800
Mon, 07 May 2001 00:00:00 -0800
Mon, 04 Jun 2001 00:00:00 -0800
Mon, 02 Jul 2001 00:00:00 -0800
Mon, 06 Aug 2001 00:00:00 -0800
Mon, 03 Sep 2001 00:00:00 -0800
Mon, 01 Oct 2001 00:00:00 -0800
Mon, 05 Nov 2001 00:00:00 -0800
Mon, 03 Dec 2001 00:00:00 -0800
Date::Manip does
everything. From the docs:
I'm trying to build a library which can do _EVERY_ con-
ceivable date/time manipulation that you'll run into in
everyday life.
-- Randal L. Schwartz, Perl hacker
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.