Think globally, act local-ly

Here’s a pattern which took me a while to figure out this past week, and therefore seemed worthy of sharing with you guys.

First, let’s set the situation.  (These are certainly not the only conditions under which you could use this pattern, but it’ll probably be easier to grasp it with a concrete example.)  Let’s say you have a script which you’re going to use to launch your other Perl scripts.  This script (in my example, it’s a bash script, but it could also be a super-minimal Perl script) has exactly one job: set up the Perl environment for all your personal or company modules.  That may even include pointing your $PATH at a different Perl (e.g. one installed via perlbrew or plenv) so you’re not reliant on the system Perl.  Here’s a typical example of what such a (bash) script might look like:

I Got Six (YAPCs)

[This is my sixth YAPC / TPC—technically, my first TPC.  If you like, you can read about my other YAPC experiences: YAPC 2011, YAPC 2013, YAPC 2014, YAPC 2015, YAPC 2016.]

After missing a year last year, I came back to attend YAPC this year.  (Yes, yes: “The Perl Conference,” now.  But it’ll probably always be “YAPC” to me.)  And I actually spoke again (second time), this time on dates and my Date::Easy module.  If you missed it and are interested in watching it, the video is up.

This year was in Salt Lake City again, and, while I normally don’t like repeating cities (mainly because I like visiting new places instead), I do have to say the Little America Hotel is every bit the excellent venue that I remembered.  Plus it’s just barely close enough to where I live that I can drive there and take the whole family, and do a sort of “conferenscation.” Which is what we did.

My highlights from this year:


The other day I ran across a pattern in our codebase at $work, and I was mightily impressed.  It solved a problem I had run into before, but the solution here was much more elegant than mine, so I’m officially stealing it.  And sharing it with you.

The problem that we’re looking at today is building Moose attributes.  Now, in and of itself, there’s nothing exciting going on there.  Perhaps we might have an attribute whose value comes out of a config file, so we might build it like so:

A Date with CPAN, Update #2: A Little Piece of Date::Piece

[This is an addendum post to a series.  You may want to begin at the beginning.  The last update was update #1.

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.]

This year is only the second time since 2011 that I’ve been unable to attend YAPC::NA.  Since I couldn’t make it out to hang with my Perl peeps in person, I thought the least I could do is offer up a long-awaited update to Date::Easy.

This latest version (available now-ish on CPAN as 0.03_01, and to be upgraded to 0.04 within the next few days assuming CPAN Testers approves) contains a few small updates, and one big one.  First, the miscellaneous bits:

Of Dates, and Sigs, and Shiny Things (and cabbages and kings)

You know, I’ve been trying to analyze my working patterns lately, and I think I’ve hit on something.  Looking back over the past few years, it seems like I get obsessed with one particular project, work frantically on it and produce lots of great stuff, then I get distracted and next thing I know I’m obsessing over an entirely different project.  And then sometimes I circle back around to the first project, but it’s usually a long time later.  I’m actually starting to wonder if maybe I have some undiagnosed ADHD (not only because of the easily distracted, but also because of the hyperfocus, and SQUIRREL!).  Anyways, that appears to be the pattern of my life, so I think at this point I’m just going to have to learn to roll with it.

Now, why would you care about all this?  Well, most probably you don’t.  And that’s fine.  But insofar as you might care, you might care because some of those projects are Perl projects, and many of those Perl projects are CPAN modules (or will be someday (assuming I don’t get distracted (again (sort of like this sentence)))).  For instance, many of you first heard of me in connection with my work on Method::Signatures, which there was quite a lot of, back in the day.  In that particular case, I was aided not only by becoming obsessed with making signatures work in Perl, but also because I could spend $work time on it, which radically increases the amount of code I can crank out.  So I was able to do a lot with MSig, over the course of about a year, before I got distracted by other shiny things, and that was nice, but now it’s feeling a bit neglected and needs some love.1  For instance, I just now noticed that I released a trial version over six months ago that I just plain forgot to promote to a full release.  So ... sorry about that (and it should be there now).  Not much new there except a few compatibility features with native signatures, but still.