SPUG: add to default @INC

Brian Hatch spug at ifokr.org
Fri Jul 18 15:50:55 CDT 2003



> I am wondering how to add a couple more pathes to the default @INC.

The default in /usr/bin/perl itself?  IE without adding any
'-I/addl/path/' options or 'BEGIN { push @INC qw(/addl/path/)}'
blocks to your code?

Hmmn.  Recompile would definitely work.  Don't see anything
in Config.pm, which is where I think I would have seen it if
it weren't compiled in.  Perhaps there's some other location
you could slap it that is always used.  Let's see:


	$ strace perl -e 'print ' 2>&1 | grep open|grep -v ENOENT
	open("/etc/ld.so.cache", O_RDONLY)      = 3
	open("/usr/lib/libperl.so.5.6", O_RDONLY) = 3
	open("/lib/libdl.so.2", O_RDONLY)       = 3
	open("/lib/libm.so.6", O_RDONLY)        = 3
	open("/lib/libc.so.6", O_RDONLY)        = 3
	open("/lib/libcrypt.so.1", O_RDONLY)    = 3
	open("/dev/null", O_RDONLY|O_LARGEFILE) = 3

Nope, no libs are read by default, it's a compile-time default.

Perhaps move /usr/bin/perl  to /usr/bin/perl.real and make the following
for /usr/bin/perl


	#!/bin/sh

	exec /usr/bin/perl.real -I/addl/path1 -I/addl/path2 "$@"
	exit 1

Should do the trick.



--
Brian Hatch                  Theists think all gods
   Systems and                but theirs are false.
   Security Engineer          Atheists simply don't
http://www.ifokr.org/bri/     make an exception for
                              the last one.
Every message PGP signed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/spug-list/attachments/20030718/be8ffabb/attachment.bin


More information about the spug-list mailing list