Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • A few comments from a brief look at the code.

    * I think you have trimester and quartermaster the wrong way round.

    * Does 'quartermaster' have the meaning you're trying to give it here? Maybe it should be 'quartermester'.

    * Your calculation of whether a year is a leap year is incorrect (1900 and 2100 are not leap years).

    * Would it make sense to also have a "make_gm_hash" function?

    * Looks like most (all?) of your reference data hashes would be better implemented as arrays.

    * With a module that only exists i
    • * 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 als

      • * 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.

  • Looks quite like Time::localtime to me.

    Maybe you should return an object instead of hash, that way if you decide to add something that requires non trivial calculation only those people interested in it pay the cost.
    • 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 :-)
  • Stands a very good chance of becoming like Time::Piece. Maybe that's what you're after.