Install XML::LibXML without root

Get a source tarball for libxml2-dev. On `apt` systems:

apt-get source libxml2-dev

Configure it to install locally, and then install it:

cd libxml2-dev/
./configure --prefix=/home/peters/perl5/alien/
make
make install

Ignoring all other options like LIBS, INC, and the rest of the stuff that's kindly recommended, you only care about showing Makefile.PL where to find xml2config:

perl Makefile.PL XMLPREFIX=~/perl5/alien/

And then it should cleanly make.

Install Net::SSLeay without root

Want to install Net::SSLeay on a Debian or Ubuntu system that you don't have root on, and doesn't have `libssl-dev` installed? Let me see if I can save you some time...

You are going to need to keep a compiled version of libssl around, and so you need to decide where that will live: I went for: `~/perl5/alien`...

mkdir ~/perl5/alien-src mkdir ~/perl5/alien

cd ~/perl5/alien-src

apt-get source lib64z1-dev # Or the 32 bit version
apt-get source libssl-dev

cd zlib-1.2.3.4.dfsg/ # Or whatever it is
./configure --prefix=~/perl5/alien
/var/www/users/peter_sergeant/index.html

Perl as CPAN glue

Quite a while I got interested in the idea of short, clear examples showing Perl as glue for CPAN. I recently refound these, and they caught my imagination:

Hiring Senior Devs in London

I'm hiring two positions in my team in lovely, sunny Canary Wharf (London)...

It took me a long time to write the job ads, so please have a good read! :-)

MooseX::Params::Validate

Subroutines that take more than a single argument should really be using something like MooseX::Params::Validate.

Consider:

sub vivisect { 
my ( $self, $args ) = @_;
confess 'Expected a hashref of arguments' unless 'HASH' eq ref $args;

my $hamster = $args->{hamster};

OK, so we know it accepts a hashref of arguments, and what's more, we know one of them is called hamster. But: what constitutes an acceptable hamster? What do we want to …