Hi again,
I tried our code, using as well this directive in my httpd.conf file:
PerlResponseHandler MyPackage
To make your handler work as the main Response Handler.
Moreover I had to alter your code to make it work, adding a:
use Apache2::RequestRec;
because otherwise, the content_type method is not defined.
And it worked perfectly (returning 'hello';)
#******************************************
package MyPackage;
use strict;
use warnings;
use Win32::OLE;
use Apache2::RequestRec;
sub handler
{
my $r = shift;
$r->content_type('text/plain');
print 'hello';
return Apache2::Const::OK;
}
1;
#******************************************
For your information, I am using:
Apache/2.0.59 (Win32) mod_perl/2.0.3 Perl/v5.8.8
perl and MP are ActiveState builds.
And I downloaded the Win32 binary from the Apache httpd website.
Lionel.
----- Original Message -----
From: "Foo JH" <[EMAIL PROTECTED]>
To: "Lionel MARTIN" <[EMAIL PROTECTED]>
Cc: "mod_perl" <modperl@perl.apache.org>
Sent: Friday, June 08, 2007 10:43 AM
Subject: Re: Loading Win32::OLE in a modperl package
Thanks Lionel,
I'm running Apache2.2 + Perl5.88.
Try this piece of code:
package MyPackage;
use strict;
use warnings;
use Win32::OLE;
sub handler
{
my $r = shift;
$r->content_type('text/plain');
print 'hello';
return Apache2::Const::OK;
}
1;
Lionel MARTIN wrote:
Basically,
Doing, in test.pl, run by ModPel::Registry, something like:
use Win32::OLE;
print 'Hello';
Works prefectly...
Which versions (Apache, MP and Perl) are you running?
----- Original Message ----- From: "Foo JH" <[EMAIL PROTECTED]>
To: "mod_perl" <modperl@perl.apache.org>
Sent: Friday, June 08, 2007 10:29 AM
Subject: Loading Win32::OLE in a modperl package
Hi all,
I wonder if I am alone in experiencing this. Simply put: putting 'use
Win32::OLE' in my modperl package will cause the Apache to fault. It
basically can't start at all.
A window will pop up complaining about 'Apache HTTP Server has
encountered a problem and needs to close'. No entry into the error log.
Does anyone know if this can be worked around?