oyse has asked for the wisdom of the Perl Monks concerning the following question:

Greetings fellow monks,

I hope that some of you could enlighten me on the following:

If I have a module that depends on C code like DBD::ODBC that is compiled for Perl 5.8, will that compiled version of the module still work in Perl 5.10 if I copy it from a Perl 5.8 lib directory to a Perl 5.10 lib directory?

The reason that I am wondering is that we have started to add all the CPAN modules that we use to our source code repository. This has removed some annoying problem we had with installations of modules to a site/lib directory and also provides a much better control over versioning and when to upgrade modules. However we have so far only added pure Perl modules to the repository and not those dependent on compiled code. I now plan to also added the compiled code the repository, but I need to know if there are any compatibility problems first.

  • Comment on Compiled modules compatible across Perl versions

Replies are listed 'Best First'.
Re: Compiled modules compatible across Perl versions
by Bloodnok (Vicar) on Aug 03, 2009 at 09:28 UTC
    You may get lucky ... but the odds are stacked so overwhelmingly against you that you should always perform a full perl Makefile.PL ; make install cycle for each module on every combination of platform i.e. OS c/w platform & perl version.

    By that means, you will have run the unit tests against module on the OS version/perl version and if the installation was successful (unless you forced the install), already have removed one of the variables if you hit problems later...

    A user level that continues to overstate my experience :-))
Re: Compiled modules compatible across Perl versions
by Anonymous Monk on Aug 03, 2009 at 07:06 UTC
    If I have a module that depends on C code like DBD::ODBC that is compiled for Perl 5.8, will that compiled version of the module still work in Perl 5.10 if I copy it from a Perl 5.8 lib directory to a Perl 5.10 lib directory?

    Absolutely not. See PPM/PPM::Make.

Re: Compiled modules compatible across Perl versions
by leocharre (Priest) on Aug 03, 2009 at 15:22 UTC

    Personally, working in an environment where things have to work right otherwise my head rolls- I would not do that even if my boss threatened to fire me otherwise.

    Please don't mess with the internals of the system- and the filesystem hierarchy created by installations. You can write a shell script to make installation easier of the modules you need.

    Just, don't just copy over stuff from x.x/ to y.y/ - bad juju.

    Don't do that.