[plug] Dynamic Perl Library Pathing...
ryan at is.as.geeky.as
ryan at is.as.geeky.as
Mon Oct 14 15:17:33 WST 2002
> I'm trying to distribute a few perl scripts with dependent custom
libraries
> which are installed relative to the script, and NOT within the main Perl
lib
> heirarchy. Normally, I'd hard-code the path into a "use lib" call before
> use-ing the other libraries, but if I'm going to be putting this on
several
> systems, and letting others at it, I'd rather not have to manually edit
the
> scripts all the time.
I have used the second grey box on this page (the require sub):
http://www.perldoc.com/perl5.8.0/pod/func/require.html to suck in modules
recursively from a given point as a 'plugin' type feature. If the module is
in the directory it gets loaded, otherwise not. In my case I just used some
standard File::find routines to do the job. If you want to know EXACTLY
what I did with it, contact me off-list and I'll explain it.
That require sub along with some File::find magic and your regexes to find
the starting point could do what you need.
Ryan
More information about the plug
mailing list