in reply to Upgrading XS module to later version

I don't have a direct answer handy, but just some experience: If you want to work with Ubuntu's Perl build, then I find the easiest is to work within Ubuntu's system: sudo apt-get install libdatetime-perl. Mixing the system Perl with cpan-built modules can sometimes work well, sometimes not, and it seems you've hit one of the latter cases. Since you seem to be comfortable with this kind of thing, why not just install a self-built Perl in e.g. /opt/perl5.18? That's worked great for me so far; I can install modules via cpan, cpanm, and manual Makefile.PL installs without problems and without worrying about affecting Ubuntu's Perl at all.

Replies are listed 'Best First'.
Re^2: Upgrading XS module to later version
by clerew (Novice) on Jun 19, 2015 at 15:50 UTC

    Yes, using sudo apt-get install libdatetime-perl seems a good idea, especially for a basic module such as DateTime, which seems a useful thing to have around. Not so sure I want to clutter /usr with every Cpan Module I fancy trying out and might never use again. So I did that, and then got:

    cpan[1]> m DateTime CPAN: Storable loaded ok (v2.41) Reading '/usr/local/CPAN/Metadata' Database was generated on Tue, 16 Jun 2015 21:53:20 GMT Module id = DateTime CPAN_USERID DROLSKY (Dave Rolsky <autarch@urth.org>) CPAN_VERSION 1.19 CPAN_FILE D/DR/DROLSKY/DateTime-1.19.tar.gz UPLOAD_DATE 2015-05-31 MANPAGE DateTime - A date and time object INST_FILE /usr/lib/perl5/DateTime.pm INST_VERSION 1.06
    So it had actually installed v1.06 (presumably the latest Ubuntu had got around to) although it knew that a later v1.19 existed.

    Fortunately, my application did not care about that version, but promptly declared that what it really wanted was DateTime/Format/Mail.pm, which then downloaded via Cpan; my application then ran, and hit a bug which I shall now have to sort out.

      what it really wanted was DateTime/Format/Mail.pm

      sudo apt-get install libdatetime-format-mail-perl

      Those module versions will always lag behind the current ones, sometimes significantly, but they should always play nice with Ubuntu's Perl installation (that's the whole point). If you want to install a bunch of custom CPAN modules, I'd recommend a Perl built just for that in /opt, where you can experiment and it can easily be clobbered and re-installed in case things do happen to get messed up. Either that, or install all modules locally, e.g. local::lib. A messed up system Perl can be tricky to pick apart and revert to a clean state. Also remember that there are Perl scripts that are part of other Ubuntu packages which rely on a working system Perl.