From: James Edward Gray II <[EMAIL PROTECTED]> > use Path::To::Module;
Beg::Your::Pardon? 1) this will not help him. This'll cause perl to search for Module.pm in all Path/To subdirectories of directories in @INC. But he needs to add something to @INC. 2) If you do this the module will most probably not initialize properly. In this case perl would assume there will be package Path::To::Module; in the Module.pm. And it will try to call the import() function in that package. > On Wednesday, October 16, 2002, at 10:05 AM, Reinstein, Shlomo wrote: > > > Hi, > > From some perl script, say "some_path/lib/sos.pl", I would like to > > make use of a perl module, which is located at "some_path/modules". > > I don't know what "some_path" is inside "sos.pl", but I know that I > > can reach the module using a relative path "../modules". The problem > > is, writing "use lib '../modules'" treats the path as a relative > > path to the current directory, and not to the directory of "sos.pl" > > (if I understood correctly). Is there a way that I can say in > > "sos.pl" that I want to use the module located in "../modules" > > relative to it? Thanks, Shlomo use FindBin qw($Bin); # this wil store the directory containing the script into $Bin use lib $Bin.'/../modules'; # this will add the directory you need to # @INC (list of library directories) Jenda =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]