in reply to Variable to point to library?

If I were you, I'd create an environment variable which holds the location of all my perl scripts (say WWW_PERLLIB). This does usually imply editing a file, at least under Linux (/home/username/.bash_profile). Then use Perl's mechanism to extract the environment variable's value ($ENV{$variable}) like this:
use lib $ENV{"WWW_PERLLIB"}; use Validate; ...

Replies are listed 'Best First'.
Re^2: Variable to point to library?
by castaway (Parson) on Jul 11, 2004 at 07:23 UTC
    Nice idea, except there already is one, it's called PERL5LIB, which perl automatically looks for and adds to its @INC (lib path array). Thus removing the need for 'use lib' at all.


      Doesn't this assume a cgi version of Perl? How about if using mod_perl?