Good Day PerlMonks

I have written some perl modules to perform some functions and put them all in a directory. At the moment, every module has something like the following in it...

use lib 'C:\My\Module\Directory'; use myModule1 qw(:All); use myModule2 qw(:All); ...

Unfortunately, if I move the folder then the modules can't use each other because they suddenly don't know where they are. While I am happy to update the folder locations by modifying the module files every time I move them, it is not elegant and prone to breakage, can't be sent to other people, etc...

I was wondering if there was a more elegant solution to this problem than specifying a directory in every file. Is there a better way of organising these module files?


In reply to Accesing Module directory by ns550

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.