Perl

Learning the perl debugger: Lesson 3

pbug-workshop-attendees

This post follows on from lesson 2 in this series of posts.

If you’ve followed the lessons so far you’ll have some basic knowledge around starting the debugger and examining variables.

It’s time to find out how to descend into the depths of some code, stepping into functions.

Continue reading

Hack Days

Raspberry Photo Booth

IMG_20140123_102849
At a recent meeting, some ideas for an office event were being discussed, and people were considering hiring a photo-booth for the evening. I had a huge lightbulb moment: we’ve had a photo booth in the office and at some staff events already — why do we keep paying other people to do this? Surely we can create our own for a fraction of the cost?

How hard can it be?

This is the question I set out to answer in our most recent Hack Day.

Continue reading

Open Source

DBIx::MultiRow – Updating multiple database rows quickly and easily

A requirement arises in many systems to update multiple SQL database rows. For small numbers of rows requiring updates, it can be adequate to use an UPDATE statement for each row that requires an update. But if there are a large number of rows that require an update, then the overhead of issuing large numbers of UPDATE statements can result in the operation as a whole taking a long time to complete.

Continue reading

Perl

Role up! Role up! (but keep hold of your Moose and make your meta immutable)

So what’s this immutable stuff all about? In short, it’s the Moose equivalent of

use strict;
use warnings;

Summary: Stick

__PACKAGE__->meta->make_immutable;

at the bottom of every Moose class unless you really know what you’re doing. It makes your code safer (and faster).

Continue reading

Hack Days

Hack-A-Porter VI – Return of the meaningful AJAX error message

As our latest hack days approached, rather than the usual panic of biting off more than I could chew and getting everything done in a huge rush, I decided I was just going to fix something that annoyed me. I was also going to miss one of the two hack days as I was off on holiday, so I knew I had to keep the idea small. All that said, the best decision I made was enlisting the help of my venerable colleague Colin Dearing — more on why later.

Continue reading