use lib relative pathnames - redux



Hello,

I'm trying to use libraries that are relative to the perl module or
script that's being called.

The below code will not work
use lib '../lib'
if I execute the script from a different drive letter, or from a
different directory in Windows.

I found this thread from 8 years ago: http://tinyurl.com/drsoh

Some people were going to use the following code:

use lib File::Basename::dirname(__FILE__) . "../lib";

Is there a more up to date solution?

Thanks,
--Nate

.



Relevant Pages

  • Re: Cross-compiling =?iso-8859-1?Q?f=FCr?= Win32
    ... wann das Script gestartet wird? ... bei jeder neuen Version einer Lib ... Bei einer Howto wäre das böse Erwachen ... Es ist ja auch nicht wirklich ersichtlich, in wessen Interesse ausser ...
    (de.comp.os.unix.programming)
  • Modules and different paths
    ... users of the script crazy. ... lib module to set INC but to do that at run vs compile time I have to do ... My thought was since the syntax for 'use' is ... is this a reasonable way to deal with rpms that install into multiple ...
    (comp.lang.perl.misc)
  • Re: Adding drop-in modules to a program
    ... > ability to have a module directory, so to speak, where others can write ... Check out the 'lib' pragma, ... If you have modules relative to your script, ... perldoc FindBin ...
    (perl.beginners)
  • Re: Trying to locate module in parallel directory
    ... this script and the required modules may be used by others and I ... > the third method, I've added FindBin. ... I am assuming from your description that the path to 'lib' is always ... This also allows me to override any base module at a vhost specific level. ...
    (perl.beginners)
  • Re: CGI: Execute a perl script inside another perl script
    ... xad wrote: ... > use lib '.'; ... > and the script y.pl is well executed ... (Or you can use the FindBin module, even if it isn't mod_perl or taint ...
    (comp.lang.perl.misc)