Feeds:
Posts
Comments

Archive for December, 2013

Leon Timmermans on my manual Makefile.PL incantation.

"No, this is wrong in so many subtle way I don’t know where to start…

… Secondly PREFIX is batshit insane, if you think you know how it works you’re wrong.

Thirdly, this is likely to break on XS modules, given you’re not including the archlib…"

Ouch!

Leon has a huge amount of experience with the module building tool chain, so normally he is someone I’d like to be paying attention to. And in one way he’s right – my understanding of EU::MM is very superficial.

However, calling Makefile.PL in this way works, and works well. I’ve installed over 100 modules with exactly this incantion.

It works for XS modules too. I’ve installed plenty of XS-based modules including DBD::[various stuff], JSON::XS, Starman (including its XS dependency…) and heaps more.

In all cases, make all test install worked just fine. Perl and XS built, tests run successfully and everything installed in exactly the right place. What’s not to like?


Thanks to Joel and Rick for the constructive suggestions.

Read Full Post »

The correct Makefile.PL incantation

My company’s policy for Perl in production is more or less:

  • Production Perl code must run under the vendor supplied Perl
  • Sysadmins will not install or upgrade Perl modules
  • We are allowed to install any module from CPAN

The two production platforms we target are RHEL5.5 for which vendor Perl is an uncomfortable 5.8.8 and RHEL6.2 which has a much more comfortable Perl 5.10.1.

Our development boxes do not have access to the internet proxies which makes things a little more difficult than they should be.

David Golden lists 5 ways of installing module prerequisites here.

Installing Perl Modules – Method #6

The method I use, given the constraints above is to discover the prerequisites by running Makefile.PL (or Build.PL) and download the prerequisites by hand recursively.

This approach is straightforward once you have the correct Makefile.PL incantation.

PERL_LIB="$HOME/lib/perl5"

perl -I$PERL_LIB Makefile.PL PREFIX=$PERL_LIB LIB=$PERL_LIB PERL="/usr/bin/perl -I$PERL_LIB"

Note: You could set/override environment variable PERL5LIB instead of adding the -I arguments which is probably better, but aesthetically, I prefer the version above.

Read Full Post »

Roles vs Inheritance

Some interesting discussion on roles vs inheritance on SillyMoose’s blog (h/t to Planet Moose)

The executive summary:

  • Roles are semantically safer than multiple inheritance because methods from the roles are loaded into the class at compile time and any name clashes are picked up then.
  • Roles cannot be instantiated.

Read Full Post »

Follow

Get every new post delivered to your Inbox.