Hello,

Just a question relating to module management, I had a search around but couldn't quite find the answer I am after...

I am currently using perl alongside CVS for version control (under linux). I use CVS to maintain two copies of my scripts...stable and development. I have a set of modules (which I am developing) that accompanies my main .pl script.

Say for example, I have two directories with my two versions:

/opt/scripts/stable

/opt/scripts/development

In each directory I have a copy of my .pl script and the modules. How do I word the "use lib..." in my .pl file to make sure it includes the right set of modules?

- I initially though of using "use lib ./lib" but this only works if you are in one of the above directories. (which is not always the case!)

- I then tried to do a bit of if-else at the top of my .pl file but this didn't work (I assume the "use lib" happens before anything is executed?)

So...are modules the correct way of going about this? If so, how should I go about managing these files?

Cheers Andrew


In reply to Perl module management by andrewtaz

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.