Date::MakeHash, a prototype (OK, OK, I couldn't sleep).
What I'd like to know is:
1) Is it any good?
2) Does something like that already exist on the CPAN? (because if it does, I'm having trouble finding it)
3) If it is any good and nothing like it exists (yeah, sure, get real), any general comments on it?
TIA :-)
Re: Date:: ... MakeHash? :-|
cog on 2004-11-09T11:16:43
* I think you have trimester and quartermaster the wrong way round.
Probably... I said I couldn't sleep, I didn't say I wasn't sleepy O:-)
* Does 'quartermaster' have the meaning you're trying to give it here? Maybe it should be 'quartermester'.
Probably so (I had a note here to check the meaning of the word in a dictionary)
* Your calculation of whether a year is a leap year is incorrect (1900 and 2100 are not leap years).
I am aware of that, but thanks for noting
:-) * Would it make sense to also have a "make_gm_hash" function?
I don't get this one... what would that do?
:-| * Looks like most (all?) of your reference data hashes would be better implemented as arrays.
OK. Will do.
* With a module that only exists in order to export a single subsroutine, it probably makes sense to put that subroutine in @EXPORT instead of @EXPORT_OK.
Sounds fair
Hope this helps.
It does. Thanks for your input
:-) Re: Date:: ... MakeHash? :-|
davorg on 2004-11-09T12:20:53
* Would it make sense to also have a "make_gm_hash" function?I don't get this one... what would that do?:-| It would do exactly the same thing as "make_hash", except it would use "gmtime" instead of "localtime".
A couple more suggestions:
* Call the function "make_date_hash" instead of "make_hash".
* If no argument is given, call "localtime" without an argument - to get a hash representing the current date and time.
Re:Time::localtime
cog on 2004-11-09T20:52:52
Yes, it is quite similar; but the idea of Date::MakeHash (or whatever name it would get) would be to provide a wider set of... thingies (infos) on a date (things as the week of the year, etc.)
The Date namespace is pretty clobbered up, in my opinion, and that's why I'm discussing this on my journal before uploading something like this.
The idea of the object seems good:-)
Re:Time::Piece
cog on 2004-11-10T10:58:11
So it seems. But it wasn't easy to find, though.