A Date with CPAN, Part 6: Time Won't Give Me Time

[This is a post in my latest long-ass series.  You may want to begin at the beginning.  I do not promise that the next post in the series will be next week.  Just that I will eventually finish it, someday.  Unless I get hit by a bus.

IMPORTANT NOTE!  When I provide you links to code on GitHub, I’m giving you links to particular commits.  This allows me to show you the code as it was at the time the blog post was written and insures that the code references will make sense in the context of this post.  Just be aware that the latest version of the code may be very different.]


Last time I added Time::ParseDate support to our date class, which made it fairly usable, if still incomplete.  This time I decided to concentrate on getting a first cut at our datetime class.

In many ways, the datetime class is simpler than the date class, because it doesn’t need to do anything fancy like truncate to midnight or try to ignore times and timezones when parsing.  Of course, datetimes do have to consider timezones, but I decided to defer that thorny issue until next time.

A Date with CPAN, Part 5: Everything's Relative

[This is a post in my latest long-ass series.  You may want to begin at the beginning.  I do not promise that the next post in the series will be next week.  Just that I will eventually finish it, someday.  Unless I get hit by a bus.

IMPORTANT NOTE!  When I provide you links to code on GitHub, I’m giving you links to particular commits.  This allows me to show you the code as it was at the time the blog post was written and insures that the code references will make sense in the context of this post.  Just be aware that the latest version of the code may be very different.]


Last time I actually got down to it and wrote some code: Date::Easy now has a date constructor for turning arbitrary human-readable strings into date objects.  Now it’s time to expand on that and allow even more formats.

But first, we’ll do a bit of math.

A Date with CPAN, Part 4: Construction Time Again

[This is a post in my latest, probably long-ass, series.  You may want to begin at the beginning.  I do not promise that the next post in the series will be next week.  Just that I will eventually finish it, someday.  Unless I get hit by a bus.

IMPORTANT NOTE!  When I provide you links to code on GitHub, I’m giving you links to particular commits.  This allows me to show you the code as it was at the time the blog post was written and insures that the code references will make sense in the context of this post.  Just be aware that the latest version of the code may be very different.]


Last time I babbled on for a while about my general plans, and finally came up with a name other than “my perfect date module.” This time we stop screwing around and finally write some code.

I decided to start out with the date class.  In retrospect, I sort of wished I’d started with the datetime class, as that would’ve been a lot simpler.  But the date class was more interesting, and more immediately useful, so that’s where I started, so that’s where we’ll start as well.

A Date with CPAN, Part 3: Paving While Driving

[This is a post in a new, probably long-ass, series.  You may want to begin at the beginning.  I do not promise that the next post in the series will be next week.  Just that I will eventually finish it, someday.  Unless I get hit by a bus.]


Last time I went into more details about how I might go about creating a new date module, and what I would expect it to achieve.  This time we clear out some housekeeping and try to nail down a design strategy.

Before I get into that, I should point out something fundamental: I’m still in the design process.  I once read a story about Harlan Ellison1 in which he wrote a short story, in real time, with fans watching as he did so.  As he finished each page, he posted it up on the wall (or wherever) for them to read.  The point of the story, I believe, was about revision, and to illustrate an extreme situation which might be the only case in the world where you actually couldn’t go back and fix what you wrote at the beginning.

So this is a bit like that.  Except that I won’t consider myself stuck with whatever I manage to produce at the beginning here; if I make a mistake or stumble across a better way later, I’ll go back and fix it.  If someone points out something in the comments that makes better sense than what I had in mind, I may completely change direction.  Hell, if someone comes along and says “hey, have you looked at Date:Dohickey?” and I go and look at Date::Dohickey, and it turns out that Date::Dohickey really does do everything I want, I may very well scrap the whole idea.  So I wanted to give everyone fair warning that there may be sharp turns ahead.  So hold on tight.

A Date with CPAN, Part 2: Target First, Aim Afterwards

[This is a post in a new, probably long-ass, series.  I do not promise that the next post in the series will be next week.  Just that I will eventually finish it, someday.  Unless I get hit by a bus.]


So, last time I laid out my dissatisfaction with existing date modules and described what I was looking for in a feature set out of a potential new module.  Well, a feature set is a good thing to have, but it’s a lower-level view.  Let’s take a step back and try to pin down exactly what need I want my date module to satisfy; that is, what niche am I hoping it it will fill?  When you’re looking for a date module to solve a particular problem, which problems will lead you to this one?1