SPUG: Change perl's libpth on the fly?

Scott Blachowicz sab at rresearch.com
Tue Jan 18 18:12:00 CST 2000


On Tue, Jan 18, 2000 at 12:55:11PM -0800, Ryan Erwin wrote:
> How can I change perl's libpth *without* rebuilding perl?
> Is there some variable that I can set that will take care of
> this?  Maybe some cool switch that I haven't seen.

There's a PERL5INC envar you can set:

	% PERL5LIB=.:/usr/lib perl -V
	...etc...

	Characteristics of this binary (from libperl):
	  Built under freebsd
	  Compiled at May 18 1999 02:56:17
	  %ENV:
		PERL5LIB=".:/usr/lib"
	  @INC:
		.
		/usr/lib
		/usr/libdata/perl/5.00503/mach
		/usr/libdata/perl/5.00503
		/usr/local/lib/perl5/site_perl/5.005/i386-freebsd
		/usr/local/lib/perl5/site_perl/5.005
		.

Or if you want to things dynamically in your scripts, you can do things like
this:

	use lib ($0 =~ m,(.*)/[^/]+,);

to (for instance) add the directory containing your script to the lib path.
Or, in other words, look into using the 'use lib' statement in your script.

-- 
Scott.Blachowicz at seaslug.org

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    POST TO: spug-list at pm.org        PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace ACTION below by subscribe or unsubscribe
        Email to majordomo at pm.org: ACTION spug-list your_address





More information about the spug-list mailing list