0

Our machines come with libxml2 2.7.6 pre-installed on them. However, someone needed a newer version of libxml2 and installed 2.7.8 on our networked file system. Likewise, they used this version of libxml2 to compile their version of the Perl module XML::LibXML, a Perl interface for libxml2. This was also placed on the network drive and is meant for developer use.

I am currently trying to use their compiled version of XML::LibXML. My script finds the module just fine, but when it goes to run it, it complains that it was compiled against a newer version of libxml2 than the one the script is looking at:

Warning: XML::LibXML compiled against libxml2 20708, but runtime libxml2 is older 20706

Obviously the Perl script is still looking at the system's libxml2, but I need it to use the newer version. Rather than recompiling the XML::LibXML module against the old libxml2 library again, is there any way I can tell Perl to simply use the newer libxml2 library?

YonkeyDonk64
  • 281
  • 2
  • 12

1 Answers1

1

One solution :

BEGIN{ @INC = ( "/SPECIAL/PERL/MODULES/DEV/PATH", @INC );

The string

/SPECIAL/PERL/MODULES/DEV/PATH

is the PATH before

/SPECIAL/PERL/COMPILED/MODULES/DEV/PATH/XML/LibXML.pm

If instead the problem is the library PATH (*.so), then you should modify LD_LIBRARY_PATH :

BEGIN{ $ENV{'LD_LIBRARY_PATH'} = "/SPECIAL/SYSTEM/MODULES/DEV/PATH"; }
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223
  • It can find LibXML.pm just fine, though. The issue is that its looking at the system's old libxml2 library, whereas I need it to look at our newer libxml2 library. – YonkeyDonk64 Dec 12 '14 at 19:04