Not sure what you're expecting to happen when you say it didn't change.  Are you expecting to manipulate @INC permanently?  That's not how it works.  use lib ... changes @INC only for the lifetime of the script.  Also, use lib doesn't take a space-separated string of directories, but a list of directories, if you need more than one.

Consider this:

#!/usr/bin/perl -wl use strict; BEGIN { print for @INC; print "-----" } use lib "/usr/share/perl5/vendor_perl/AnyEvent/Iml", "/foo/bar"; BEGIN { print for @INC; print "-----" } # use here whatever module lives in one of the added paths...
$ ./955116.pl /etc/perl /usr/local/lib/perl/5.12.4 /usr/local/share/perl/5.12.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12 /usr/share/perl/5.12 /usr/local/lib/site_perl . ----- /usr/share/perl5/vendor_perl/AnyEvent/Iml /foo/bar /etc/perl /usr/local/lib/perl/5.12.4 /usr/local/share/perl/5.12.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.12 /usr/share/perl/5.12 /usr/local/lib/site_perl . -----

As you can see in the second printout of @INC (after the use lib), the two directories have been added.

___

P.S.:  please use <p>...</p> (text paragraph) and <c>...</c> (code) tags to format your posts.

For example, typing

<p> inserting into the script: </p> <c> use lib "/usr/share/perl5/vendor_perl/AnyEvent/Iml"; </c> <p> also does not change the entry. </p>

will render as

inserting into the script:

use lib "/usr/share/perl5/vendor_perl/AnyEvent/Iml";

also does not change the entry.


In reply to Re^9: perl install in Fedora 16 by Eliya
in thread perl install in Fedora 16 by txflyer

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.