niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl » modules
modulespath via environment-variable ?
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Big and Blue
*nix forums addict


Joined: 21 Feb 2005
Posts: 95

PostPosted: Mon Feb 21, 2005 10:12 pm    Post subject: Re: modulespath via environment-variable ? Reply with quote

Felix Drueke wrote:
Quote:

is it possible to specify an alternative modules-path via environment-
variable?

Yes, but there are other ways to do it too, and better ones.

Quote:
we are developing a product that uses perl and some perlmodules.
We want that the modules are installed in the developers workspace
from the source-control-system and not host-wide in /usr/local/lib/perl5.
We want that the perlmodules are part of the product.

Then make them part of the product. Get the product to add:

use lib qw( dir-path1 dir-path2 etc );

at the beginning of each script.

Quote:
As we already have many perl-scripts I just want to be able to set
an environment-variable (in a "PERLHOME"-style) in order to tell all
of them that they should search in that path for modules.

However, if you do that in a global environment variable (PERL5LIB)
then *all* perl usage will start looking in those locations, which isn't
what you want.

You could also write a script interlude which execs the "real" perl,
having inserted relevant -Idir... options at the start of the argument
list. Then get the scripts to use this interlude in the #! line.


Quote:
Thanks for any hints,

Application settings go with an application, not the global system.



--
Just because I've written it doesn't mean that
either you or I have to believe it.
Back to top
Brian McCauley
*nix forums Guru Wannabe


Joined: 21 Feb 2005
Posts: 277

PostPosted: Mon Feb 21, 2005 1:09 pm    Post subject: Re: modulespath via environment-variable ? Reply with quote

Felix Drueke wrote:

Quote:
is it possible to specify an alternative modules-path via environment-
variable?

Yes.

Quote:
Thanks for any hints,

The a list of environment variables that can effect Perl can be found in
the reference manual. Actually they are not quite all in one place but
searching for the string "ENVIRONMENT" in the table of contents will
find them quickly.
Back to top
Felix Drueke
*nix forums beginner


Joined: 21 Feb 2005
Posts: 1

PostPosted: Mon Feb 21, 2005 8:19 am    Post subject: modulespath via environment-variable ? Reply with quote

Hi,

is it possible to specify an alternative modules-path via environment-
variable?

The reason I ask is:
we are developing a product that uses perl and some perlmodules.
We want that the modules are installed in the developers workspace
from the source-control-system and not host-wide in /usr/local/lib/perl5.
We want that the perlmodules are part of the product.

As we already have many perl-scripts I just want to be able to set
an environment-variable (in a "PERLHOME"-style) in order to tell all
of them that they should search in that path for modules.

Thanks for any hints,
Felix
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Wed Jan 07, 2009 8:27 pm | All times are GMT
navigation Forum index » Programming » Perl » modules
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix + MySQL error: very strange variable %s iWarior Postfix 0 Mon Aug 25, 2008 2:01 pm
No new posts User Environment - export PATH variable paalepu AIX 0 Tue Sep 12, 2006 8:12 pm
No new posts Removing db from environment mike.klaas@gmail.com Berkeley DB 0 Fri Jul 21, 2006 5:14 am
No new posts restricted environment Gabriele *darkbard* Farin python 7 Wed Jul 19, 2006 11:06 pm
No new posts mod_perl and access to the parent processes environment? Robert Nicholson modules 3 Wed Jul 19, 2006 8:41 pm

Novela romantica | Looking for Credit Cards? | Loan | Western Union Money Order | Online Advertising
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1529s ][ Queries: 20 (0.0691s) ][ GZIP on - Debug on ]