JojoLinkyBob has asked for the wisdom of the Perl Monks concerning the following question:

Our project team has developed Perl-madness, and so far we have about 72 scripts we wrote specifically for our baseline. It's now reached the point I think it would be appropriate to incorporate a lot of the common functionality into a module. The problem is that we all keep our scripts on a network drive so everyone can access them, the problem is that in order to create a module (.pm) I would need to place it in the my local \Perl\Lib directory (unless I'm wrong), but doing so makes it harder to maintain, everyone would have to copy this file to their respective \Perl\Lib directory, and everytime I change it I'd have to repeat the process. So my question is:

Is there a way to place a .pm module at a remote location, but through some kind of forwarding reference tell it where to find it? If not, I guess the next question is how would I refer to the module within my script...

use //server/dir1/dir2/jojo.pm?
Thanx in advance! Desert coder

Replies are listed 'Best First'.
Re: Creating Modules
by no_slogan (Deacon) on May 10, 2001 at 21:27 UTC
    use lib qw( //server/dir1/dir2 ); use jojo;
    If you don't want to keep including the use lib line in all your scripts (ick), set the PERL5LIB environment variable.
Re: Creating Modules
by buckaduck (Chaplain) on May 10, 2001 at 21:34 UTC
Re: Creating Modules
by Masem (Monsignor) on May 10, 2001 at 21:35 UTC
    In addition to the above solution of use lib, make sure you limit who has write access to that file(s) to only those that should be allowed to make changes. If this is to be shared, it could happen that one person needs to make a small change to the way a given support functions works, but breaking everyone else's use of it. Such changes need to be discussed and fully documented by only a limited number of people working on the project.


    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
      Thanx all, that was a quick response!
      Fortunately there are just two people here writing scripts, so it should be easy to manage.
      thx, Desert coder
Re: Creating Modules
by ckohl1 (Hermit) on May 10, 2001 at 23:28 UTC
    Here is a bit of code to add the current operating directory that a script is running from, to the search path for modules:
    use FindBin; use lib $FindBin::Bin; use YourModuleName;


    Chris
    'You can't get there from here.'