Perl 6

Wow, you people.

Making local::lib real easy to use

In bash, at least.

Just paste this (on your command line or into .bashrc or wherever else you want):

perl-lib() { eval "`perl -M'local::lib @ARGV' - "$@" 0<&-`" ; }

Then you can just say things like this:

$ perl-lib ~/locallib/foo
$ perl-lib --deactivate ~/locallib/bar
$ perl-lib --deactivate-all

… instead of having to type stuff like this:

$ eval "`perl -Mlocal::lib - --deactivate ~/locallib/bar`"

… or even, as you would have had to in old versions of local::lib, this awfulness:

$ eval "`perl -Mlocal::lib=--deactivate,$HOME/locallib/bar`"

Note that the shell function will work irrespective of local::lib version.

Update: I originally posted this with a 1<&- redirect in the function, which closes STDOUT. What I actually wanted to do was close STDIN, of course.

Developing virtualhost-aware PSGI applications: Plack::Middleware::MockProxyFrontend

Let’s say you work on a team that runs a web content management system for various different customers. It is hosted at ourcms.com, but each customer’s public content is published on a different domain, which is determined by a setting in the interface, which they can change at will. When a customer is logged into ourcms.com they see links to their public content in various places, and some of the public content has “edit this”-type links back into ourcms.com. All of this runs as a single PSGI application. A not unfamiliar scenario, presumably.

How do you spin up a development server where you can test this?

MakeMaker among the stars

It is part of our solar system now.

Now that’s legacy.

Maybe the fault is, indeed, not in our stars.

Running plenv 𝘢𝘯𝘥 perlbrew

So I just went to investigate switching from perlbrew to plenv.

This has failed before, because I run an old and grungy installation of Perl where I didn’t set up a local lib and just installed whatever without keeping records of which installed modules I need and which are just junk I tried for a few minutes. Unless I carry forward all that junk, I can’t switch perls without breaking all my local scripts – and I have better things to do.

Eventually I want to fix this situation, but no today on which it comes up has been the day for it so far.

Still, I do want to upgrade to 5.22 now that it’s out, and I’ve been wanting to switch to plenv for a while. What to do?

Uhm… *looks around*
ln -s ~/perl5/perlbrew/perls/perl-5.16.1 .plenv/versions/5.16.1
La la la… *walks away*

Yup, plenv global 5.16.1 is fine with that and a plenv rehash later, it works.

I threw out the rest of perlbrew, just kept the directory tree for the linked perl installation, and now I happily run this bastard/cuckoo setup. Teehee.

Now for installing 5.22 and making all my stuff work with it…