RE: modifying @INC permanently




Win32 changes to the environment from within your script won't be
permanent, so that won't work unless you do the system call that sets
the environment variable permanently (and also the local one, because it
won't reflect the changes to the system call until it is invoked again).

Do you have the ability to install modules on your clients? The
SetEnvVar function from Win32::AdminMisc will do what you want.

http://www.roth.net/perl/adminmisc/#SetEnvVar

You can install it via PPM from the repository
http://www.roth.net/perl/packages.


Really, though, I think I remember that it's better to 'use lib' than
change @INC. Someone here might be better able to explain why.



-----Original Message-----
From: ettinger@xxxxxxxxx [mailto:ettinger@xxxxxxxxx] On Behalf Of
Anthony Ettinger
Sent: Thursday, June 08, 2006 1:40 PM
To: Perl Beginners
Subject: modifying @INC permanently

Is there a way to modify @INC for the perl installation as a whole?

All my scripts have logic to push the same directory to @INC. It's
rather repetative.

I know I can export PERL_LIB environment variable, but I need
something for all system users (including win32).



--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

--
To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail: beginners-help@xxxxxxxx
<http://learn.perl.org/> <http://learn.perl.org/first-response>



.