I'm sure there's an obvious answer to this, but I can't seem to find it. Suppose I have these files:
/(lib path)/dirAAA/ModuleA.pm /(lib path)/dirBBB/ModuleB.pm
where (lib path) will differ from one installation to another. Also for various reasons I can't put ModuleA and ModuleB in the same directory. ModuleA needs to use ModuleB. In ModuleA I put:
use lib ???; use ModuleB;
What do I use for ??? I know that these are no good: # WRONG: relative to caller who could be anywhere:
<code> use lib '../dirAAA/'
# WRONG: relative to calling script which could be anywhere:
use FindBin; use lib "$FindBin::Bin/../dirAAA/"
How do I specify 'relative to the current file (Module A)'? My apologies for posting anonymously; I'm having trouble logging in. thanks, David

In reply to use lib between modules by Anonymous Monk

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.