As Thick As Two Short Planks - Mark Fowler's Perl Blog
92 FOLLOWERS
A stream of technical nonsense and Perl programming gumph thankfully subsumed by the trivialities of life of a Brit living in upsdate NY with a couple of kids
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
Sometimes you go through a lot of pain trying to get something to work, and you just need to write it down and put it on the internet. You tell yourself this is useful; You're doing it so that others can find your words and solve the problem too. In reality, it's just cathartic. And who doesn't like a good rant? So What Broke? I recently updated my Mac to Mavericks (OS X 10.9). Overall, I like it...but it broke something I care about. It broke libcurl's handling of certificates., and in so doing broke my install of WWW::Curl also (since it's a wrapper around the system libcurl.) This is remark ..read more
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
So a few weeks ago now, several thousand miles and two countries past, I was in Glasgow at this year’s european Perl Conference.
Photo credit Chris Jack
I was there, amongst other things, to give my talk on last year’s Perl Advent Calendar. Like similar talks in the past this involves talking really really quickly, attempting to summarize all the exciting things from all of the articles in under fifty minutes (so each article in two minutes or less.) As always, this is pretty fun to do, somewhat akin to twenty four half lightning talks, and hey, if the audience doesn’t care for what I’m talki ..read more
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
You should write an article for this year’s Perl Advent Calendar.
Yes, you. I don’t want some mythical Perl-guru who spends his days creating the Next Great Perl Framework, his evening refactoring the perl core, and stays up late at night trying to optimize his one-liners to use one less character. I want you to write an article. I want stuff from day to day Perl programmers. I want things from beginners who just picked up Perl for the first time last week and think “hey, this is a pretty cool thing”. I want people whose first language isn’t English and we can help edit the article to make it ..read more
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
Over the last week I've been noodling with a minor improvement to Perl Critic to do with private methods and roles. Sometimes I write roles that are essentially importers for utility methods - methods that are essentially imported into the class but don't become part of the public interface. Here's an example of such a role, something that allows you to write $self->_select("SELECT * FROM foo WHERE foo_id",123) on any class that has a dbh attribute.
package SuperProject::Role::WithSelect;
use Moo::Role;
requires 'dbh';
sub _select {
my $self = shift;
my $sql = shift;
my @binds ..read more
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
Last night I braved Winter Storm Juno to venture out to Albany Perl Mongers' technical meeting in East Greenbush. Our special guest star Jeff Thalhammer had agreed to teleconference in from San Francisco to talk us through Perl::Critic. This arrangement worked pretty well for us, with Jeff able to chat with the small number of us that had braved the storm and answer our questions. The only flaw with the setup was Jeff wasn't able to try the pokemon cupcakes I'd baked. Bring on cupcake-over-ip technology is what I say. I've been using Perl::Critic for many years now, and I wasn ..read more
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
Today I released a new version of Mac::Choose which wraps the choose command line utility. Basically this lets you, from Perl, pop open a fuzzy match dialog like quicksilver, alfred, et al. This is probably best shown rather than explained:
use Mac::Choose qw(choose);
print choose qw(
red
orange
yellow
green
blue
indigo
violet
) or die "User canceled selection";
The exciting thing about this release is that while previous versions required you to go to Tiny Robot Software's website to download a copy of choose, this version of Mac::Choose ships with ..read more
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
Did I ever tell you guys the story of how I once made the front page of imgur with a Perl script? As we're all aware, imgur is a imaging sharing network traditionally dedicated to such topics as funny cat photos, internet memes and other recycled content often direct from its sister site reddit. It's internet fluff in the best possible way, and what I like to browse when I'm eating lunch and I need to disconnect my brain after a morning of coding. While it's got a minority of hardcore technical members, it's not at all known for it's technical content due to posts being promot ..read more
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
One of the topics that I had scheduled for the Perl Advent Calendar this year that didn’t finally make the cut was Regexp::Debugger (It might make it next year, but let’s all pretend I never made this post if that’s the case.) I really wanted to write an article on Regexp::Debugger because it has such wow factor. You just stick a line in the source code and bam instant visual debugger. Suddenly I was finding out in minutes what was wrong with the regular expression that I’d spent half an hour figuring out writing numerous tests. Sometimes there’s no substitute for g ..read more
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
The Perl Advent Calendar is finally done and dusted for another year (apart from the typo corrections - there are always typo corrections.) Which is lucky, since I committed the last submission just two days before Christmas Eve. Let’s look at some statistics shall we? The advent calendar is a team effort:
Total articles: 25 (24 articles + xmas day)
Articles written by people than me: 13
Total number of authors (including me): 13
Number of Pull Requests For Typos (so far): 8
It’s big:
Total number of lines: 5,318
Total number of words: 27,323
Total number of graphics: 7 (inc ..read more
As Thick As Two Short Planks - Mark Fowler's Perl Blog
3y ago
A new version of Test::DatabaseRow has just escaped onto the CPAN, with a minor new feature verbose data to make working out what went wrong in the database test even easier when the worst happens In a nutshell this feature allows you to output in diagnostics all the results the database returned (not just listing the first thing that didn't match, which is the default thing row_ok does in a similar way to Test::More's is_deeply does.) In other words instead of writing this:
all_row_ok(
table => "contacts",
where => [ cid => 123 ],
tests => [ name => "t ..read more