RE: PerlRun StatInc perl5_00405

2000-11-09 Thread Chris Strom

Creating a nearly empty warnings.pm works, but I had to define the package
namespace and create the unimport method as an empty subroutine like:

##
package warnings;

sub unimport {}

1;
##

If this is done, then you need to change the following lines in PerlRun:

##
BEGIN {
if ($] < 5.006) {
$INC{'warnings.pm'} = __FILE__;
*warnings::unimport = sub {};
}
}
##

to the following (after creating warnings.pm, of course):

##
BEGIN {
if ($] < 5.006) {
require warnings;
}
}
##

This works (as does my solution of deleting and manually setting
$INC{'warnings.pm'} in a PerlInitHandler).  I'm not sure which is more
elegant, but I lean toward yours since anonymous subroutines in apache
configuration files add to clutter.

Thanks.

Chris

My hack:

>
> PerlModule  Apache::StatINC
>
> #
> # hack to keep $INC{'warnings.pm'} defined. PerlRun includes a
> # workaround for perl<5.6 which defines $INC{'warnings.pm'} and
> # ties the warnings::unimport function to an anonymous sub-routine.
> #
> PerlInitHandler "sub {delete $INC{'warnings.pm'};
> $INC{'warnings.pm'='/usr/local/lib/perl/site_perl/Apache/PerlRun.pm';}"
>
> PerlInitHandler Apache::StatINC
> PerlSetVar StatINC_UndefOnReload On
> PerlSetVar StatINC_Debug 1
> PerlWarn On
>
> PerlTaintCheck On
>
> It's not the prettiest thing, but it does what's needed.
>



Re: PerlRun StatInc perl5_00405

2000-11-08 Thread ___cliff rayman___

here is something that occurred to me, but it is untested, and could be
plain foolish.

place a file named warnings.pm in your 5_00405 include path that contains the
infamous:

1;

this may help to quiet StatInc.

Chris Strom wrote:

> No, I don't have warnings.pm.  It is only included in 5.6.  We have no plans
> on upgrading at this time.  The code snippet from PerlRun is a workaround
> for perl versions prior to the most recent release, but it appears to be
> causing problems with StatInc.
>
> perl -V reports:
> Summary of my perl5 (5.0 patchlevel 4 subversion 5) configuration:
>
> It may be that the combination of PerlRun/StatInc/perl<5.6 simply will not
> work.  If we were not using StatInc or were using perl 5.6, I do not believe
> that we would be having these problems.  Unfortunately, our development
> environment would be rather painful without StatInc and, as I said, we have
> no plans on upgrading from 5_00405.
>
> For now, I've got the following hack in perl.conf:
>
> PerlModule  Apache::StatINC
>
> #
> # hack to keep $INC{'warnings.pm'} defined. PerlRun includes a
> # workaround for perl<5.6 which defines $INC{'warnings.pm'} and
> # ties the warnings::unimport function to an anonymous sub-routine.
> #
> PerlInitHandler "sub {delete $INC{'warnings.pm'};
> $INC{'warnings.pm'='/usr/local/lib/perl/site_perl/Apache/PerlRun.pm';}"
>
> PerlInitHandler Apache::StatINC
> PerlSetVar StatINC_UndefOnReload On
> PerlSetVar StatINC_Debug 1
> PerlWarn On
>
> PerlTaintCheck On
>
> It's not the prettiest thing, but it does what's needed.
>
> -Original Message-
> From: G.W. Haywood [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 08, 2000 3:00 PM
> To: Chris Strom
> Cc: [EMAIL PROTECTED]
> Subject: Re: PerlRun StatInc perl5_00405
>
> Hi there,
>
> On Wed, 8 Nov 2000, Chris Strom wrote:
>
> > The offending item in %INC appears to be the 'warnings.pm' entry
> > defined on line 308 of PerlRun:
> >
> > BEGIN {
> > if ($] < 5.006) {
> > $INC{'warnings.pm'} = __FILE__;
> > *warnings::unimport = sub {};
> > }
> > }
>
> Do you even have the file 'warnings.pm' if you're using 5.004_05?
> I have it in a 5.6.0 inststallation, but not in 5.005_03.  That's
> why there's a test for Perl version less than 5.006 (== 5.6.0).
>
> What does Perl -V say?
>
> 73,
> Ged..

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/





RE: PerlRun StatInc perl5_00405

2000-11-08 Thread Chris Strom

No, I don't have warnings.pm.  It is only included in 5.6.  We have no plans
on upgrading at this time.  The code snippet from PerlRun is a workaround
for perl versions prior to the most recent release, but it appears to be
causing problems with StatInc.

perl -V reports:
Summary of my perl5 (5.0 patchlevel 4 subversion 5) configuration:

It may be that the combination of PerlRun/StatInc/perl<5.6 simply will not
work.  If we were not using StatInc or were using perl 5.6, I do not believe
that we would be having these problems.  Unfortunately, our development
environment would be rather painful without StatInc and, as I said, we have
no plans on upgrading from 5_00405.

For now, I've got the following hack in perl.conf:

PerlModule  Apache::StatINC

#
# hack to keep $INC{'warnings.pm'} defined. PerlRun includes a 
# workaround for perl<5.6 which defines $INC{'warnings.pm'} and 
# ties the warnings::unimport function to an anonymous sub-routine.
#
PerlInitHandler "sub {delete $INC{'warnings.pm'};
$INC{'warnings.pm'='/usr/local/lib/perl/site_perl/Apache/PerlRun.pm';}"

PerlInitHandler Apache::StatINC
PerlSetVar StatINC_UndefOnReload On
PerlSetVar StatINC_Debug 1
PerlWarn On

PerlTaintCheck On

It's not the prettiest thing, but it does what's needed.

-Original Message-
From: G.W. Haywood [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 08, 2000 3:00 PM
To: Chris Strom
Cc: [EMAIL PROTECTED]
Subject: Re: PerlRun StatInc perl5_00405


Hi there,

On Wed, 8 Nov 2000, Chris Strom wrote:

> The offending item in %INC appears to be the 'warnings.pm' entry
> defined on line 308 of PerlRun:
> 
> BEGIN {
> if ($] < 5.006) {
> $INC{'warnings.pm'} = __FILE__;
> *warnings::unimport = sub {};
> }
> }

Do you even have the file 'warnings.pm' if you're using 5.004_05?
I have it in a 5.6.0 inststallation, but not in 5.005_03.  That's
why there's a test for Perl version less than 5.006 (== 5.6.0).

What does Perl -V say?

73,
Ged..



Re: PerlRun StatInc perl5_00405

2000-11-08 Thread G.W. Haywood

Hi there,

On Wed, 8 Nov 2000, Chris Strom wrote:

> The offending item in %INC appears to be the 'warnings.pm' entry
> defined on line 308 of PerlRun:
> 
> BEGIN {
> if ($] < 5.006) {
> $INC{'warnings.pm'} = __FILE__;
> *warnings::unimport = sub {};
> }
> }

Do you even have the file 'warnings.pm' if you're using 5.004_05?
I have it in a 5.6.0 inststallation, but not in 5.005_03.  That's
why there's a test for Perl version less than 5.006 (== 5.6.0).

What does Perl -V say?

73,
Ged.




PerlRun StatInc perl5_00405

2000-11-08 Thread Chris Strom

I'm having trouble using PerlRun with the StatInc module.  The symptom is
several error log file entries of the form:

[Wed Nov  8 11:12:20 2000] PerlInitHandler subroutine
`Apache::StatINC::handler' : Apache::StatINC: Can't locate

The offending item in %INC appears to be the 'warnings.pm' entry defined on
line 308 of PerlRun:

BEGIN {
if ($] < 5.006) {
$INC{'warnings.pm'} = __FILE__;
*warnings::unimport = sub {};
}
}

The value for this entry is still defined after the PerlModule
Apache::PerlRun directive, but, by the time the PerlHandler is invoked,
$INC{'warnings.pm'} evaluates to undef (the key is still defined, just not
its value).  This, of course, causes StatInc to generate the above error
message.

We're using Bundle::Apache 1.02, perl 5_00405.  

My perl.conf file contains the following:

PerlFreshRestartOn

PerlModule  Apache::StatINC
PerlInitHandler Apache::StatINC
PerlSetVar StatINC_UndefOnReload On
PerlSetVar StatINC_Debug 1
PerlWarn On

PerlTaintCheck On


My virtual server contains the following:

  Alias /cgi-bin /path/to/cgi-bin
  PerlModule Apache::PerlRun

  
SetHandler perl-script
PerlHandler Apache::PerlRun
Options +ExecCGI
PerlSendHeader On
  


Any help here would be most appreciated.  Thanks!

Chris