[Phoenix-pm] greetings

Artful ahenry-pm at artful2099.com
Wed Jul 28 12:52:24 CDT 2004

> Perl programs won't "see" this module by default as its in a place that
> perl
> wasn't told about when it was built (and it isn't in the default place to
> install modules), but you can easily tell perl about it by saying:
>   use lib '/usr/local/share/departments/r_and_d/shared_files/mp3s/';
> Then the 'use' for that module will work:
>   use Foo::Bar;
> You could even install the module into your home directory, as long as
> permissions were in order for your college's to see the module...
> or they could install a copy in their home directory and do something in
> the program using the module like:
>   BEGIN {
>       my($name,$passwd,$uid,$gid,
> $quota,$comment,$gcos,$dir,$shell,$expire) = getpwuid $<;
>       push @INC, $dir . '/perl_modules';
>   }
> But that's fugly =P

I develop a lot of perl modules for my applications and I always install
them outside of the standard @INC directories.  For a while I was using
the "use lib" command at the beginning of my scripts, but this wasn't very
portable.  I have found the best way to handle this is to use the PERL5LIB
environment variable.

Putting something like "export PERL5LIB=$PERL5LIB:~/lib/perl5/" or "export
into your .profile will add the directory to your @INC every time to log


More information about the Phoenix-pm mailing list