Hi all,
I have 5.10.0 installed in my system(SUSE Linux).
I have a product installed in /opt which has its bundled perl of version 5.8.8.
Consider a script 8.pl of this product which runs using 5.8.8 perl(using shebang line).Also consider a script 10.pl which uses(using shebang line). 10.pl needs a module M which is available in 5.10's module location as well as in 5.8.8's module location under /opt.
Now 8.pl needs to invoke 10.pl as a system command. Now, the problem is- M being loaded is from 5.8.8 module stack and not the system stack of 5.10. The two versions of M are incompatible.
The problem is that @INC array is set as per 5.8.8's module locations when 8.pl is run. Here is the @INC array when 8.pl starts:
/opt/zmanda/amanda/perl/lib/5.8.8/i686-linux-thread-multi
/opt/zmanda/amanda/perl/lib/5.8.8
/opt/zmanda/amanda/perl/lib/site_perl/5.8.8/i686-linux-thread-multi
/opt/zmanda/amanda/perl/lib/site_perl/5.8.8
/opt/zmanda/amanda/perl/lib/5.8.8/i686-linux-thread-multi
/opt/zmanda/amanda/perl/lib/5.8.8
/opt/zmanda/amanda/perl/lib/site_perl/5.8.8/i686-linux-thread-multi
/opt/zmanda/amanda/perl/lib/site_perl/5.8.8
/bitrock/zmanda/output/perl/lib/5.8.8/i686-linux-thread-multi
/bitrock/zmanda/output/perl/lib/5.8.8
/bitrock/zmanda/output/perl/lib/site_perl/5.8.8/i686-linux-thread-mult
+i
/bitrock/zmanda/output/perl/lib/site_perl/5.8.8
/bitrock/zmanda/output/perl/lib/site_perl
Now when 10.pl runs from 8.pl, the @INC array has this:
/opt/zmanda/amanda/perl/lib/5.8.8
/opt/zmanda/amanda/perl/lib/site_perl/5.8.8
/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi
/usr/lib/perl5/5.10.0
/usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.10.0
/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.10.0
/usr/lib/perl5/vendor_perl
Note the first 2 paths here. There belong to 5.8.8 perl.Rest paths are correctly perl 5.10's.How to do this?
I tried wiping out @INC array before calling 10.pl by
@INC = ();
before running 10.pl. But it doesn't help.
Any help much appreciated..
Thanks,
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.