CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
How Can I use one module which is compiled with another perl version

 



shekarperl
New User

May 14, 2014, 3:45 AM

Post #1 of 4 (11571 views)
How Can I use one module which is compiled with another perl version Can't Post

One module is compiled with /opt/msys/3rdParty/bin/perl and some modules are compiled with /usr/bin/perl.
How can I use the module which is is compiled with /opt/msys/3rdParty/bin/perl in another script which is compiling with /usr/bin/perl.

If I use 'lib path' the it is showing as Can't locate xxxx.pm in @INC error.

Also please note that these versions are different. Can any body please help on this?

Thanks in advance.


FishMonger
Veteran / Moderator

May 14, 2014, 6:32 AM

Post #2 of 4 (11504 views)
Re: [shekarperl] How Can I use one module which is compiled with another perl version [In reply to] Can't Post

It would be helpful if you told us what perl versions you're working with and if the modules are pure perl or do they use XS code.

Compiled modules using XS code are not binary compatible across different versions of perl. Your best solution would be to compile the modules for each version of perl.

If the modules are pure perl, then they can be used with multiple perl versions. In this case you can use a use lib statement to add the desired path to @INC or you can copy the module to a location already within the @INC paths


shekarperl
New User

May 14, 2014, 6:44 AM

Post #3 of 4 (11496 views)
Re: [FishMonger] How Can I use one module which is compiled with another perl version [In reply to] Can't Post

use Ecelerity::Injector;
use JLog::Reader;
The above two are compiled with /opt/msys/3rdParty/bin/perl.

We need to use these two modules in a perl script which need to be compiled with /usr/bin/perl


[daemons]$ perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[daemons]$ /opt/msys/3rdParty/bin/perl -v

This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi

Copyright 1987-2012, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.


FishMonger
Veteran / Moderator

May 14, 2014, 6:52 AM

Post #4 of 4 (11489 views)
Re: [shekarperl] How Can I use one module which is compiled with another perl version [In reply to] Can't Post

Modules compiled against v5.16 which use XS code are not binary compatible with v5.10.

You need to recompile the modules so that you can have 2 distinct versions, one for each version of perl.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives