Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Variable to point to library?

by perldeveloper (Scribe)
on Jul 10, 2004 at 21:36 UTC ( [id://373402]=note: print w/replies, xml ) Need Help??


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.

    C.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://373402]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found