Re: Why isn't PerlSetEnv working for me?

2000-09-29 Thread Keith G. Murphy

Doug MacEachern wrote:
 
 On Wed, 27 Sep 2000, Keith G. Murphy wrote:
 
  Upon further investigation, what I am seeing is that PERL5LIB gets
  passed into %ENV just fine.  It's just not being used to locate modules;
  it is not in @INC.  Could the part of Perl that pushes the PERL5LIB
  setting to @INC have already executed prior to my PerlSetEnv statement?
 
 i don't think so, it's set by mod_perl.c on every request, in
 perl_per_request_init():
 /* SetEnv PERL5LIB */
 if (!MP_INCPUSH(cld)) {
 char *path = (char *)table_get(r-subprocess_env, "PERL5LIB");
 
 if (path) {
 perl_incpush(path);
 MP_INCPUSH_on(cld);
 }
 }
 
 what version of mod_perl are you using?

1.21_03-dev (it's the one in the current Debian release).



Re: Why isn't PerlSetEnv working for me?

2000-09-29 Thread Doug MacEachern

On Fri, 29 Sep 2000, Stas Bekman wrote:
 
 Hmm, I didn't take it out of my head, I cannot remember now when it was
 added. Was it different before and I've missed the patch?

according to changes, it's been there 1.00_02.
 
 Anyway, that means that I should fix the guide, to remove the note about
 PERL5LIB and PerlTaintMode, right?

right.




Re: Why isn't PerlSetEnv working for me?

2000-09-28 Thread Doug MacEachern

On Tue, 26 Sep 2000, Keith G. Murphy wrote:

 I'm running Apache 1.3.9 with mod_perl embedded, on Debian GNU/Linux.
 
 I have the following lines towards the end of my httpd.conf:
 
 PerlSetEnv PERL5LIB /usr/local/MyPerl/lib
 PerlRequire startup.pl
 Include perllocs.conf
 
 However, upon system startup, my startup.pl fails because it can't find
 a particular module in the @INC list.
 
 If I start Apache from the command line, it works.  This is undoubtedly
 because PERL5LIB is set up in my /etc/profile, to the same path.
 
 I've looked at this until I'm crosseyed.  Seemingly PerlSetEnv just
 doesn't work.
 
 Any ideas?  Yes, I know the workaround: 'use lib' in startup.pl.  But
 why?

PerlSetEnv PERL5LIB works fine for me, and should work regardless of
PerlTaintCheck, because mod_perl treats it special (note for the guide,
stas).

mod_perl-x.xx/t/conf/httpd.conf has this config:

Location /perl/perl-status
PerlSetVar StatusOptionsAll On
SetHandler perl-script
PerlHandler +Apache::Status
PerlSetEnv PERL5LIB /home/dougm/lib/perl
/Location

which i can see as the last @INC entry printed by:
/perl-status?inc




Re: Why isn't PerlSetEnv working for me?

2000-09-28 Thread Doug MacEachern

On Wed, 27 Sep 2000, Keith G. Murphy wrote:
 
 Upon further investigation, what I am seeing is that PERL5LIB gets
 passed into %ENV just fine.  It's just not being used to locate modules;
 it is not in @INC.  Could the part of Perl that pushes the PERL5LIB
 setting to @INC have already executed prior to my PerlSetEnv statement?

i don't think so, it's set by mod_perl.c on every request, in
perl_per_request_init():
/* SetEnv PERL5LIB */
if (!MP_INCPUSH(cld)) {
char *path = (char *)table_get(r-subprocess_env, "PERL5LIB");

if (path) {
perl_incpush(path);
MP_INCPUSH_on(cld);
}
}

what version of mod_perl are you using?




Re: Why isn't PerlSetEnv working for me?

2000-09-28 Thread Stas Bekman

On Thu, 28 Sep 2000, Doug MacEachern wrote:

 On Tue, 26 Sep 2000, Keith G. Murphy wrote:
 
  I'm running Apache 1.3.9 with mod_perl embedded, on Debian GNU/Linux.
  
  I have the following lines towards the end of my httpd.conf:
  
  PerlSetEnv PERL5LIB /usr/local/MyPerl/lib
  PerlRequire startup.pl
  Include perllocs.conf
  
  However, upon system startup, my startup.pl fails because it can't find
  a particular module in the @INC list.
  
  If I start Apache from the command line, it works.  This is undoubtedly
  because PERL5LIB is set up in my /etc/profile, to the same path.
  
  I've looked at this until I'm crosseyed.  Seemingly PerlSetEnv just
  doesn't work.
  
  Any ideas?  Yes, I know the workaround: 'use lib' in startup.pl.  But
  why?
 
 PerlSetEnv PERL5LIB works fine for me, and should work regardless of
 PerlTaintCheck, because mod_perl treats it special (note for the guide,
 stas).

Hmm, I didn't take it out of my head, I cannot remember now when it was
added. Was it different before and I've missed the patch?

Anyway, that means that I should fix the guide, to remove the note about
PERL5LIB and PerlTaintMode, right?

 mod_perl-x.xx/t/conf/httpd.conf has this config:
 
 Location /perl/perl-status
 PerlSetVar StatusOptionsAll On
 SetHandler perl-script
 PerlHandler +Apache::Status
 PerlSetEnv PERL5LIB /home/dougm/lib/perl
 /Location
 
 which i can see as the last @INC entry printed by:
 /perl-status?inc
 
 



_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com   perl.org   apache.org





Re: Why isn't PerlSetEnv working for me?

2000-09-27 Thread Keith G. Murphy

Stas Bekman wrote:
 
 On Tue, 26 Sep 2000, Keith G. Murphy wrote:
 
  I'm running Apache 1.3.9 with mod_perl embedded, on Debian GNU/Linux.
 
  I have the following lines towards the end of my httpd.conf:
 
  PerlSetEnv PERL5LIB /usr/local/MyPerl/lib
  PerlRequire startup.pl
  Include perllocs.conf
 
  However, upon system startup, my startup.pl fails because it can't find
  a particular module in the @INC list.
 
  If I start Apache from the command line, it works.  This is undoubtedly
  because PERL5LIB is set up in my /etc/profile, to the same path.
 
  I've looked at this until I'm crosseyed.  Seemingly PerlSetEnv just
  doesn't work.
 
  Any ideas?  Yes, I know the workaround: 'use lib' in startup.pl.  But
  why?
 
 
 http://thingy.kcilink.com/modperlguide/config/PerlSetVar_PerlSetEnv_and_PerlP.html

Yes, I have looked at that.
 
 Regarding the setting of PerlPassEnv PERL5LIB in httpd.conf: if you turn
 on taint checks (PerlTaintCheck On), $ENV{PERL5LIB} will be ignored
 (unset). See the 'Switches -w, -T' section.
 
I can explicitly set it *off*:

PerlTaintCheck Off

and still get the same behavior.

Upon further investigation, what I am seeing is that PERL5LIB gets
passed into %ENV just fine.  It's just not being used to locate modules;
it is not in @INC.  Could the part of Perl that pushes the PERL5LIB
setting to @INC have already executed prior to my PerlSetEnv statement?

If so, that would certainly limit the usefulness of PerlSetEnv for that
purpose.  Maybe some note should be made in the docs.  Or can someone
confirm that it works for them?



Re: Why isn't PerlSetEnv working for me?

2000-09-27 Thread Keith G. Murphy

Chris Winters wrote:
 
 * Keith G. Murphy ([EMAIL PROTECTED]) [000926 18:43]:
  I'm running Apache 1.3.9 with mod_perl embedded, on Debian GNU/Linux.
 
  I have the following lines towards the end of my httpd.conf:
 
  PerlSetEnv PERL5LIB /usr/local/MyPerl/lib
  PerlRequire startup.pl
  Include perllocs.conf
 
  However, upon system startup, my startup.pl fails because it can't find
  a particular module in the @INC list.
 
  If I start Apache from the command line, it works.  This is undoubtedly
  because PERL5LIB is set up in my /etc/profile, to the same path.
 
  I've looked at this until I'm crosseyed.  Seemingly PerlSetEnv just
  doesn't work.
 
  Any ideas?  Yes, I know the workaround: 'use lib' in startup.pl.  But
  why?
 
 There's another workaround:
 
 in httpd.conf:
 
 Perl
   use lib qw( /usr/local/MyPerl/lib );
 /Perl
 
 Pretty painless :)
 
That's a great workaround (from both Chrises), that I will use.  :-) 
Thanks.



Why isn't PerlSetEnv working for me?

2000-09-26 Thread Keith G. Murphy

I'm running Apache 1.3.9 with mod_perl embedded, on Debian GNU/Linux.

I have the following lines towards the end of my httpd.conf:

PerlSetEnv PERL5LIB /usr/local/MyPerl/lib
PerlRequire startup.pl
Include perllocs.conf

However, upon system startup, my startup.pl fails because it can't find
a particular module in the @INC list.

If I start Apache from the command line, it works.  This is undoubtedly
because PERL5LIB is set up in my /etc/profile, to the same path.

I've looked at this until I'm crosseyed.  Seemingly PerlSetEnv just
doesn't work.

Any ideas?  Yes, I know the workaround: 'use lib' in startup.pl.  But
why?



Re: Why isn't PerlSetEnv working for me?

2000-09-26 Thread Chris Winters

* Keith G. Murphy ([EMAIL PROTECTED]) [000926 18:43]:
 I'm running Apache 1.3.9 with mod_perl embedded, on Debian GNU/Linux.
 
 I have the following lines towards the end of my httpd.conf:
 
 PerlSetEnv PERL5LIB /usr/local/MyPerl/lib
 PerlRequire startup.pl
 Include perllocs.conf
 
 However, upon system startup, my startup.pl fails because it can't find
 a particular module in the @INC list.
 
 If I start Apache from the command line, it works.  This is undoubtedly
 because PERL5LIB is set up in my /etc/profile, to the same path.
 
 I've looked at this until I'm crosseyed.  Seemingly PerlSetEnv just
 doesn't work.
 
 Any ideas?  Yes, I know the workaround: 'use lib' in startup.pl.  But
 why?

There's another workaround:

in httpd.conf:

Perl 
  use lib qw( /usr/local/MyPerl/lib ); 
/Perl

Pretty painless :)

Chris

-- 
Chris Winters
Senior Internet Developerintes.net
[EMAIL PROTECTED]   http://www.intes.net/
Integrated hardware/software solutions to make the Internet work for you.



RE: Why isn't PerlSetEnv working for me?

2000-09-26 Thread Christian Gilmore

If you have a startup.pl, why not just

  use lib qw(/usr/local/MyPerl/lib);

within the startup.pl script?

Regards,
Christian

 -Original Message-
 From: Keith G. Murphy [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 26, 2000 5:32 PM
 To: [EMAIL PROTECTED]
 Subject: Why isn't PerlSetEnv working for me?
 
 
 I'm running Apache 1.3.9 with mod_perl embedded, on Debian GNU/Linux.
 
 I have the following lines towards the end of my httpd.conf:
 
 PerlSetEnv PERL5LIB /usr/local/MyPerl/lib
 PerlRequire startup.pl
 Include perllocs.conf
 
 However, upon system startup, my startup.pl fails because it 
 can't find
 a particular module in the @INC list.
 
 If I start Apache from the command line, it works.  This is 
 undoubtedly
 because PERL5LIB is set up in my /etc/profile, to the same path.
 
 I've looked at this until I'm crosseyed.  Seemingly PerlSetEnv just
 doesn't work.
 
 Any ideas?  Yes, I know the workaround: 'use lib' in startup.pl.  But
 why?
 



Re: Why isn't PerlSetEnv working for me?

2000-09-26 Thread Stas Bekman

On Tue, 26 Sep 2000, Keith G. Murphy wrote:

 I'm running Apache 1.3.9 with mod_perl embedded, on Debian GNU/Linux.
 
 I have the following lines towards the end of my httpd.conf:
 
 PerlSetEnv PERL5LIB /usr/local/MyPerl/lib
 PerlRequire startup.pl
 Include perllocs.conf
 
 However, upon system startup, my startup.pl fails because it can't find
 a particular module in the @INC list.
 
 If I start Apache from the command line, it works.  This is undoubtedly
 because PERL5LIB is set up in my /etc/profile, to the same path.
 
 I've looked at this until I'm crosseyed.  Seemingly PerlSetEnv just
 doesn't work.
 
 Any ideas?  Yes, I know the workaround: 'use lib' in startup.pl.  But
 why?
 

http://thingy.kcilink.com/modperlguide/config/PerlSetVar_PerlSetEnv_and_PerlP.html

Regarding the setting of PerlPassEnv PERL5LIB in httpd.conf: if you turn
on taint checks (PerlTaintCheck On), $ENV{PERL5LIB} will be ignored
(unset). See the 'Switches -w, -T' section.

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://jazzvalley.com
http://singlesheaven.com http://perlmonth.com   perl.org   apache.org