andrewtaz has asked for the wisdom of the Perl Monks concerning the following question:
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl module management
by moritz (Cardinal) on Jul 20, 2009 at 07:59 UTC | |
|
Re: Perl module management
by Bloodnok (Vicar) on Jul 20, 2009 at 11:58 UTC | |
by andrewtaz (Initiate) on Jul 23, 2009 at 01:14 UTC | |
by Bloodnok (Vicar) on Jul 23, 2009 at 09:13 UTC | |
|
Re: Perl module management
by Anonymous Monk on Jul 20, 2009 at 12:31 UTC |