Re: can perl modules be used by various versions of perl?



garey wrote:

Hello -

I have an application that will move between two machines. It
will normally run on the first machine; if the machine or the
application fails, the application and the directory structure that
contains it will move to the second machine.

In the application I use several PERL modules. I have an
installation of PERL on each machine, and at the moment, both
installations are version 5.8.8.

My worry is that, if at some point the PERL versions
inadvertently get out of sync, the PERL modules will stop functioning
correctly, because the PERL modules only work with one version of
PERL.

So my question is 'what is the relation between a PERL module and
the PERL it was compiled with?'. Is there a wide range of PERL
versions a particular module will work with? or is the PERL module
limited to working only with the PERL in whose library it is found?

I can't find any documentation that states how this works,
probably because the answer is so obvious. But not to me.

Any help would be appreciated;

Garey Mills

Perl isn't compiled per-se (well not in the way that python is to a .pyc or
java to a .class). It is pseudo-compiled to perl bytecode upon every
invocation of the script[1].

As to version, with a little care it's not hard to have perl script that is
good for 5.6.1 through 5.8.8. You get some funnies like 5.6 doesn't like:

use constant
{
foo => 'bar',
bar => 'foo',
};

when it's OK for some later version, but:

use constant foo => 'bar';
use constant bar => 'foo';

is find on both.

Perl has a pretty good record on compatibility. When I was working at
Imperial College London, we had scripts that ran off NFS mounts that worked
fine across random perl versions on Linux and Solaris covering 5.6.x to
5.8.6.

XS modules may be more delicate, but not too dire.

This is why sysadmins tend to like perl: CPAN + a certain degree of
constancy makes for a reliable and useful language.

HTH

Tim

[1] Perl d00dz are probably going to say: what about B::Bytecode?
Don't care, sysadmins don't usually try that trick ;->
.



Relevant Pages

  • DBD module loading problem
    ... Objective - execute perl modules from apache that access an oracle database ... Apache server - RHAS 4.0, ... Perl Version ...
    (perl.dbi.users)
  • RE: Hi, how to extract five texts on each side of an URI? I post my own perl script and its use.
    ... Chakrabarti placed relevance on distance from the link. ... changed your report to reflect this relevance. ... Here you will find All Things Perl. ... -1: Perl modules ...
    (perl.beginners)
  • Re: Management of Enterprise Computing
    ... i> I have been tasked to create a system for managing enterprise ... i> We are going to use 'perl' for this and I would like to know what ... i> computers at once, watching for stuff, etc. ... for which perl modules support an enterprise management system is ...
    (comp.lang.perl.misc)
  • Re: Perl with MySQL
    ... I've seen this problem with several perl modules, ... I posted a message indicating that I was getting errors ... >when I install Perl modules. ...
    (perl.dbi.users)
  • Re: PHP Modules? and perl.
    ... sysadmins and maybe big ticket n-server stuff. ... perl is pretty much useless for the web side. ... One thing perl has that I've never really seen in PHP is the ... PHP seems to require a special die handler function and a whole lot of ...
    (comp.lang.php)