Jason,

JC> I want to use perl thats installed on a server
JC> here at work. I want to install modules that will
JC> enhance my scripts, avoiding having to do calls
JC> to the shell for things that perl already has in
JC> place. How can i do this? I know that its more of
JC> a unix question, but I hope that there is something
JC> that can be done.

Take a look at chapter-2 in "Learning Perl Objects and References".

There are really a few things you could do. Perl will search for shared code
alone a path, which can be manipulated from the shell or a script. You can
deploy modules and other shared code to a directory in your home directory
(e.g. /users/my_home_dir/perl-lib/) then add that directory to Perl's path.
If you are adding the directory to Perl's path with-in a script you will
need to manipulate the @inc array.

#! /usr/bin/perl

use strict;
use warnings; 

unshift(@inc, '/users/my_home_dir/perl-lib');

...code...

Keep in mind you would need to add this to any script that took advantage of
a module in that directory.

Your other option is to modify the path through the environment variable
(PERLLIB5) - see your shell's documentation for instructions on setting
shell variables. Using BASH this is how I would set this variable (I use
BASH):

export PERLIB5='/users/my_home_dir/perl-lib';

After you do all this you can deploy modules to your personal library and
use them from there.

Regards,
Adam




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to