in reply to perl wrapped in batch

If you want a library path relative to the perl-script's location, you can do this:
use FindBin; use lib "$FindBin::Bin/path/to/modules"; use Other::Module;
see FindBin for more info.
-- Joost downtime n. The period during which a system is error-free and immune from user input.

Replies are listed 'Best First'.
Re: Re: perl wrapped in batch
by Anonymous Monk on Nov 18, 2002 at 17:14 UTC
    Thanks for your help joost. it seems from your inclusion that I need to know the path to the modules beforehand. the client will be setting the path to the modules in the environment (via My Computer) so i will not know this path. please tell me if i misunderstood. Is there anyway in perl to get the path the OS uses (after searching the PATH) to run the script? thanks again, michael
      ah, I see,

      The easiest way for this is to set the environment variable PERL5LIB instead of PATH to point to the module files.

      From perlrun:

      PERL5LIB
      A colon-separated list of directories in which to look for Perl library files before looking in the standard library and the current directory.
      Any architecture-specific directories under the specified locations are automatically included if they exist. If PERL5LIB is not defined, PERLLIB is used.
      -- Joost downtime n. The period during which a system is error-free and immune from user input.