Andy Wardley wrote:
Marco Marongiu wrote:

NAME
   Date::Iterator - Iterate over a range of dates


Nice!

Thanks Andy!


$i = Date::Iterator->new( from => [2003,12,1], to => [2003,12,10] )


As a matter of convenience, can I suggest that in addition to list references you also allow dates to be specified as strings?


$i = Date::Iterator->new( from => '2003/12/1', to => '2003/12/10' )


Something like this should do the trick:

$date = ref $date eq 'ARRAY' ? $date : [ split(/\D+/, $date) ];

If you split on any non-digit characters then it allows for different
formats like '2003/12/1', '2003-12-1', '2003 12 1' and so on.

Yup! Really nice idea! I'll go for it!!!


Thanks a lot
--bronto

--
Marco Marongiu                            Email: [EMAIL PROTECTED]
System Administrator                      Phone: +39 070 460 1684
Tiscali S.p.A.                            Fax:   +39 070 460 9684
International IT Services



Reply via email to