If adding use lib "."; fixes a problem && "." is included in @INC, then my first thought is that something removes "." from @INC.

I would think that this removal would have happened inside the perl code, and at compile time - eg inside a BEGIN{} block.
So that would be the fist place to look.

If you have a script in which you have included use lib ".";, try inserting immediately *before* that line:
BEGIN {print "$_\n" for @INC;};
If that shows you that "." was present during the execution of the BEGIN{} block, then the inclusion of use lib "."; would do nothing more than put "." at the *beginning* of @INC. That is, instead of having "." last in the @INC search path, it is now *first*.
Could that be the key to the success with use lib "."; in your case ?

(There are perhaps other scenarios that I've overlooked.)

Cheers,
Rob

In reply to Re^3: use lib current directory by syphilis
in thread use lib current directory by viradan

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.