If I'm understanding you correctly, you want 10.pl to look in additional lib directories, which are not set by default when 10.pl is being run via system from within 8.pl (?)

If so, you could set PERL5LIB prior to calling 10.pl, or call the perl interpreter explicitly, passing it the additional lib directories via one or more -I options (see perlrun).

Update: actually, reading the other replies, it appears you don't want the 5.8 directories on the lib list for 10.pl ... in which case try unsetting PERL5LIBPERL5LIB might be one reason for them being there.


In reply to Re: @INC array and two perl versions by almut
in thread @INC array and two perl versions by nikunjv

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.