[This patch is against mod_perl 1.26]
PerlSetEnv PERL5LIB /foo/bar
push()es its argument to @INC, instead of unshift(). blead perldoc
perlrun says (Thanks to Stas for pointing this)
=item PERL5LIB
A colon-separated list of directories in which to look for Perl library
files before looking in the standard library and the current
^^^^^^
directory. Any architecture-specific directories under the specified
locations are automatically included if they exist. If PERL5LIB is not
defined, PERLLIB is used.
Patch below fixes this:
===================================================================
RCS file: RCS/mod_perl.c,v
retrieving revision 1.1
diff -u -r1.1 mod_perl.c
--- mod_perl.c 2001/10/29 07:37:12 1.1
+++ mod_perl.c 2001/10/29 07:38:24
@@ -747,7 +747,7 @@
#endif
#ifdef APACHE_PERL5LIB
- perl_incpush(APACHE_PERL5LIB);
+ perl_inc_unshift(APACHE_PERL5LIB);
#else
av_push(GvAV(incgv), newSVpv(server_root_relative(p,""),0));
av_push(GvAV(incgv), newSVpv(server_root_relative(p,"lib/perl"),0));
@@ -1411,7 +1411,7 @@
char *path = (char *)table_get(r->subprocess_env, "PERL5LIB");
if (path) {
- perl_incpush(path);
+ perl_inc_unshift(path);
MP_INCPUSH_on(cld);
}
}
===================================================================
RCS file: RCS/mod_perl.h,v
retrieving revision 1.1
diff -u -r1.1 mod_perl.h
--- mod_perl.h 2001/10/29 07:37:15 1.1
+++ mod_perl.h 2001/10/29 07:38:48
@@ -1177,7 +1177,7 @@
void mod_perl_init_ids(void);
int perl_eval_ok(server_rec *s);
int perl_sv_is_http_code(SV *sv, int *status);
-void perl_incpush(char *s);
+void perl_inc_unshift(char *s);
SV *mod_perl_sv_name(SV *svp);
void mod_perl_mark_where(char *where, SV *sub);
===================================================================
RCS file: RCS/perl_util.c,v
retrieving revision 1.1
diff -u -r1.1 perl_util.c
--- perl_util.c 2001/10/29 07:37:24 1.1
+++ perl_util.c 2001/10/29 08:40:54
@@ -785,7 +785,7 @@
#define PERLLIB_SEP ':'
#endif
-void perl_incpush(char *p)
+void perl_inc_unshift(char *p)
{
if(!p) return;
@@ -803,7 +803,8 @@
sv_setpv(libdir, p);
p = Nullch;
}
- av_push(GvAV(incgv), libdir);
+ av_unshift(GvAV(incgv), 1);
+ av_store(GvAV(incgv), 0, libdir);
}
}
--
Tatsuhiko Miyagawa <[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]