Re: [mp2] ModPerl-Registry redirect test

2003-12-04 Thread Randy Kobes
On Wed, 3 Dec 2003, Stas Bekman wrote:

> Randy Kobes wrote:
> [...]
> > I think if one wants to grow old fast, offer to help
> > maintain File::Spec :)
>
> There is a better candidate, ExtUtils::MakeMaker. I wonder
> how old was Michael 2 years ago. ;)

:)

[ .. ]
> So if you have:
> C:\\MODPERL~1 => C:\\mod_perl-foo-1
> D:\\MODPERL~1 => D:\\mod_perl-bar-1
>
> and pass MODPERL~1 to Win32::GetLongPathName() without the drive, it will
> expand it as if C:\\mod_perl-foo-1 (if cwd is somewhere in C:\\) even if
> D:\\mod_perl-bar-1 was intended. I guess that's expected, and you better not
> forget to pass that drive letter... ;)

Drive letters are such stupid things ...

> +1 plus probably add an inlined comment for both explaining why there are
> needed, and the pod sections. i'd also add a comment that GetLongPathName
> requires an absolute path to work.
>
> > -my $script_file = catfile $vars->{serverroot}, 'cgi-bin', 'basic.pl';
> > +my $script_file = t_catfile_apache($vars->{serverroot}, 'cgi-bin', 'basic.pl');
>
> no need for () as it's imported.
>
> > -my $script_file = catfile $vars->{serverroot}, 'cgi-bin', 'basic.pl';
> > +my $script_file = t_catfile_apache($vars->{serverroot}, 'cgi-bin', 
> > 'basic.pl');
>
> ditto

I just committed that - thanks, Stas!

-- 
best regards,
randy

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[mp2] mod_perl test suite fails

2003-12-04 Thread Volker Kroll
Havn't seen the mail go through, so I resend it.

Regards
Volker


-8<-- Start Bug Report 8<--
1. Problem Description:

mod_perl compiles fine but all tests seem to fail.

in the error log I do find:

**03 14:42:34 2003] [error] failed to resolve handler `TestHooks::trans'
[Wed Dec 03 14:42:34 2003] [error] [client 127.0.0.1] Can't locate
TestHooks/trans.pm in @INC (@INC contains:
/root/mod_perl-1.99_11/Apache-Test/lib /root/mod_perl-1.99_11/t/response
/root/mod_perl-1.99_11/t/protocol /root/mod_perl-1.99_11/t/preconnection
/root/mod_perl-1.99_11/t/hooks /root/mod_perl-1.99_11/t/filter
/root/mod_perl-1.99_11/t
/root/mod_perl-1.99_11/t/htdocs/testdirective/perlmodule-vh
/root/mod_perl-1.99_11/t/htdocs/testdirective/main
/root/mod_perl-1.99_11/t/ /root/mod_perl-1.99_11/t/lib/perl
/root/mod_perl-1.99_11/blib/lib /root/mod_perl-1.99_11/blib/arch
/usr/lib/perl5/5.8.2/i686-linux-thread-multi /usr/lib/perl5/5.8.2
/usr/lib/perl5/site_perl/5.8.2/i686-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.2 /usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl) at (eval 66)
line 3.

but the file does exist.

 mod_perl version 1.9911


*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_APXS=> /usr/local/apache-perl/bin/apxs
  MP_COMPAT_1X   => 1
  MP_GENERATE_XS => 1
  MP_LIBNAME => mod_perl
  MP_USE_DSO => 1
  MP_USE_STATIC  => 1


*** /usr/local/apache-perl/bin/httpd -V
Server version: Apache/2.0.48
Server built:   Dec  3 2003 14:06:59
Server's Module Magic Number: 20020903:4
Architecture:   32-bit
Server compiled with
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local/apache-perl"
 -D SUEXEC_BIN="/usr/local/apache-perl/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


*** /usr/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
  Platform:
osname=linux, osvers=2.4.9-e.27, archname=i686-linux-thread-multi
uname='linux batman 2.4.9-e.27 #1 fri nov 14 13:05:14 cet 2003 i686
unknown '
config_args='-des -Dversion=5.8.2 [EMAIL PROTECTED]
-Dcc=gcc -Dinstallprefix=/usr -Dprefix=/usr -Dsiteprefix=/usr
-Dotherlibdirs=/usr/lib/perl5/5.8.2 -Duseshrplib -Dusethreads
-Duseithreads -Dd_dosuid -Dd_semctl_semun -Di_shadow -Di_syslog
-Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005
-Uversiononly -Darchname=i686-linux -Dpager=/usr/bin/less -isr'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='2.96 2731 (Red Hat Linux 7.2
2.96-118.7.2)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
  Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.2.4.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.2.4'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic
-Wl,-rpath,/usr/lib/perl5/5.8.2/i686-linux-thread-multi/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Dec  3 2003 11:01:30
  %ENV:
PERL_LWP_USE_HTTP_10="1"
  @INC:
/usr/lib/perl5/5.8.2/i686-linux-thread-multi
/usr/lib/perl5/5.8.2
/usr/lib/perl5/site_perl/5.8.2/i686-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.2
/usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/5.8.2/i686-linux-thread-multi
/usr/lib/perl5/5.

Re: [MP2] failed to resolve handler `Apache::PerlSections'

2003-12-04 Thread Geoffrey Young

> 
> I'm little bit surprised because in mp2 1.9910 the same configuration works.

yeah.  gozer is the guy to ask about what has changed, though.

> 
> Moreover also works in mp2 1.9911 (without adding explicitly "PerlModule
> Apache::PerlSections") this configuration:
> 
>LoadModule perl_module modules/mod_perl.so
>PerlModule Apache2
>
>   use lib '/home/lib/perl';
>
>PerlModule Apache::Status

yes, that's what I meant by making sure Apache::Status doesn't require()
Apache::PerlSections - here  is doing the require()ing via
modperl_mgv* routines, which appear to add some magic behind the scenes.

--Geoff


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[MP2] failed to resolve handler `Apache::PerlSections'

2003-12-04 Thread Enrico Sorcinelli
Hi all,

with this simple configuration (Apache 2.0.47 / mod_perl 1.9911):

   ...
   LoadModule perl_module modules/mod_perl.so
   PerlModule Apache2
   PerlModule Apache::Status
   
  use lib '/home/lib/perl';
   
   ...

I've this error (the server doesn't start at all):

[Thu Dec 04 14:14:31 2003] [error] failed to resolve handler `Apache::PerlSections'
Syntax error on line 12 of /usr/local/apache-2.0.47/conf/mod_perl.conf:
 handler Apache::PerlSections failed with status=500 

The same directives work fine with until mp2 1.9910.

Moreover, if I comment "PerlModule Apache::Status" line or I move it after first
 section in httpd.conf file, the server starts.

I don't think that this depend on Apache::Status because it's the same between
1.9910 and 19911.

by

- Enrico


-8<-- Start Bug Report 8<--
2. Used Components and their Configuration:

*** mod_perl version 1.9911

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_APXS => /usr/local/apache-2.0.47/bin/apxs
  MP_COMPAT_1X=> 1
  MP_GENERATE_XS  => 1
  MP_INST_APACHE2 => 1
  MP_LIBNAME  => mod_perl
  MP_USE_DSO  => 1
  MP_USE_STATIC   => 1


*** /usr/local/apache-2.0.47/bin/httpd -V
Server version: Apache/2.0.47
Server built:   Oct 26 2003 15:02:00
Server's Module Magic Number: 20020903:4
Architecture:   32-bit
Server compiled with
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/usr/local/apache-2.0.47"
 -D SUEXEC_BIN="/usr/local/apache-2.0.47/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"


*** /usr/local/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration:
  Platform:
osname=linux, osvers=2.4.22, archname=i686-linux-thread-multi
uname='linux sorcinelli 2.4.22 #6 tue sep 2 17:43:01 pdt 2003 i686 unknown unknown 
gnulinux '
config_args='-des -Dprefix=/usr/local -Dusethreads'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFS
optimize='-O3',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing 
-I/usr/local/include'
ccversion='', gccversion='3.2.3', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.2'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
 
 
Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Oct 26 2003 10:34:52
  %ENV:
PERL_LWP_USE_HTTP_10="1"
  @INC:
/usr/local/lib/perl5/5.8.1/i686-linux-thread-multi
/usr/local/lib/perl5/5.8.1
/usr/local/lib/perl5/site_perl/5.8.1/i686-linux-thread-multi
/usr/local/lib/perl5/site_perl/5.8.1
/usr/local/lib/perl5/site_perl
.
 

This report was generated by t/REPORT on Thu Dec  4 13:19:20 2003 GMT.
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [MP2] failed to resolve handler `Apache::PerlSections'

2003-12-04 Thread Geoffrey Young


Enrico Sorcinelli wrote:
> Hi all,
> 
> with this simple configuration (Apache 2.0.47 / mod_perl 1.9911):
> 
>...
>LoadModule perl_module modules/mod_perl.so
>PerlModule Apache2
>PerlModule Apache::Status
>
>   use lib '/home/lib/perl';
>
>...
> 
> I've this error (the server doesn't start at all):
> 
> [Thu Dec 04 14:14:31 2003] [error] failed to resolve handler `Apache::PerlSections'
> Syntax error on line 12 of /usr/local/apache-2.0.47/conf/mod_perl.conf:
>  handler Apache::PerlSections failed with status=500 
> 
> The same directives work fine with until mp2 1.9910.
> 
> Moreover, if I comment "PerlModule Apache::Status" line or I move it after first
>  section in httpd.conf file, the server starts.

because PerlSections::handler() is a method handler, you need to

PerlModule Apache::PerlSections

so that the require() in Apache::Status isn't the one to load the module.

in mp1 any kind of pre-loading was ok for method handlers, but this leads me
to believe that PerlModule is somehow required.  I dunno, though.

HTH

--Geoff


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [MP2] failed to resolve handler `Apache::PerlSections'

2003-12-04 Thread Enrico Sorcinelli
On Thu, 04 Dec 2003 09:37:13 -0500
Geoffrey Young <[EMAIL PROTECTED]> wrote:

> 
> 
> Enrico Sorcinelli wrote:
> > Hi all,
> > 
> > with this simple configuration (Apache 2.0.47 / mod_perl 1.9911):
> > 
> >...
> >LoadModule perl_module modules/mod_perl.so
> >PerlModule Apache2
> >PerlModule Apache::Status
> >
> >   use lib '/home/lib/perl';
> >
> >...
> > 
> > I've this error (the server doesn't start at all):
> > 
> > [Thu Dec 04 14:14:31 2003] [error] failed to resolve handler `Apache::PerlSections'
> > Syntax error on line 12 of /usr/local/apache-2.0.47/conf/mod_perl.conf:
> >  handler Apache::PerlSections failed with status=500 
> > 
> > The same directives work fine with until mp2 1.9910.
> > 
> > Moreover, if I comment "PerlModule Apache::Status" line or I move it after first
> >  section in httpd.conf file, the server starts.
> 
> because PerlSections::handler() is a method handler, you need to
> 
> PerlModule Apache::PerlSections
> 
> so that the require() in Apache::Status isn't the one to load the module.

Thanks, I've seen: maybe it's needed to document this in Apache::Status docs (or
fix it at all)?

I'm little bit surprised because in mp2 1.9910 the same configuration works.

Moreover also works in mp2 1.9911 (without adding explicitly "PerlModule
Apache::PerlSections") this configuration:

   LoadModule perl_module modules/mod_perl.so
   PerlModule Apache2
   
  use lib '/home/lib/perl';
   
   PerlModule Apache::Status

by

- Enrico


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [MP2] failed to resolve handler `Apache::PerlSections'

2003-12-04 Thread Stas Bekman
Enrico Sorcinelli wrote:
Hi all,

with this simple configuration (Apache 2.0.47 / mod_perl 1.9911):

   ...
   LoadModule perl_module modules/mod_perl.so
   PerlModule Apache2
   PerlModule Apache::Status
   
  use lib '/home/lib/perl';
   
   ...
I've this error (the server doesn't start at all):

[Thu Dec 04 14:14:31 2003] [error] failed to resolve handler `Apache::PerlSections'
Syntax error on line 12 of /usr/local/apache-2.0.47/conf/mod_perl.conf:
 handler Apache::PerlSections failed with status=500 

The same directives work fine with until mp2 1.9910.

Moreover, if I comment "PerlModule Apache::Status" line or I move it after first
 section in httpd.conf file, the server starts.
I don't think that this depend on Apache::Status because it's the same between
1.9910 and 19911.
Thank you Enrico for the report.

The problem seems to be as following: Apache::Status somehow autovivifies 
Apache::PerlSections stash, while Apache/PerlSections.pm wasn't loaded yet. 
That's why preloading Apache::PerlSections solves the problem. Our code does 
not attempt to load packages whose stashes exist, which is obviously wrong. 
I'll post a patch soonish. I think instead of checking for the stash, we need 
to check %INC.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [mp2] mod_perl test suite fails

2003-12-04 Thread Stas Bekman
Volker Kroll wrote:
Havn't seen the mail go through, so I resend it.

Regards
Volker
-8<-- Start Bug Report 8<--
1. Problem Description:
mod_perl compiles fine but all tests seem to fail.

in the error log I do find:

**03 14:42:34 2003] [error] failed to resolve handler `TestHooks::trans'
[Wed Dec 03 14:42:34 2003] [error] [client 127.0.0.1] Can't locate
TestHooks/trans.pm in @INC (@INC contains:
My favorite bug report. Can you please rebuild mp with MP_TRACE=1

perl Makefile.PL ... MP_TRACE=1

and post the output of run

% rm t/logs/error_log
% MOD_PERL_TRACE=gh t/TEST
and t/logs/error_log itself

if it's too big please send it off-list to me.

Thanks.

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [MP2] failed to resolve handler `Apache::PerlSections'

2003-12-04 Thread Stas Bekman
Stas Bekman wrote:
[...]
The problem seems to be as following: Apache::Status somehow 
autovivifies Apache::PerlSections stash, while Apache/PerlSections.pm 
wasn't loaded yet. That's why preloading Apache::PerlSections solves the 
problem. Our code does not attempt to load packages whose stashes exist, 
which is obviously wrong. I'll post a patch soonish. I think instead of 
checking for the stash, we need to check %INC.
It was a bit trickier than I thought, but now the code is even simpler to 
follow. This should solve your problem Enrico. 'make test' pass 100% with this 
patch.

Index: src/modules/perl/modperl_mgv.c
===
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_mgv.c,v
retrieving revision 1.27
diff -u -r1.27 modperl_mgv.c
--- src/modules/perl/modperl_mgv.c  18 Sep 2003 07:58:46 -  1.27
+++ src/modules/perl/modperl_mgv.c  5 Dec 2003 01:06:47 -
@@ -181,6 +181,31 @@
 }
 #endif
+
+static void package2filename(apr_pool_t *p, const char *package,
+ char **filename, int *len)
+{
+*filename = apr_palloc(p, (strlen(package)+4)*sizeof(char));
+const char *s;
+char *d;
+
+for (s = package, d = *filename; *s; s++, d++) {
+if (*s == ':' && s[1] == ':') {
+*d = '/';
+s++;
+}
+else {
+*d = *s;
+}
+}
+*d++ = '.';
+*d++ = 'p';
+*d++ = 'm';
+*d   = '\0';
+
+*len = d - *filename;
+}
+
 /* currently used for complex filters attributes parsing */
 /* XXX: may want to generalize it for any handlers */
 #define MODPERL_MGV_DEEP_RESOLVE(handler, p) \
@@ -259,25 +284,44 @@
 }
 }
-if (!(stash || (stash = gv_stashpv(name, FALSE))) &&
-MpHandlerAUTOLOAD(handler)) {
-MP_TRACE_h(MP_FUNC,
-   "package %s not defined, attempting to load\n", name);
-
-if (modperl_require_module(aTHX_ name, FALSE)) {
-MP_TRACE_h(MP_FUNC, "loaded %s package\n", name);
-if (!(stash = gv_stashpv(name, FALSE))) {
-MP_TRACE_h(MP_FUNC, "%s package still does not exist\n",
-   name);
+if (!stash && MpHandlerAUTOLOAD(handler)) {
+int len;
+char *filename;
+SV **svp;
+
+package2filename(p, name, &filename, &len);
+svp = hv_fetch(GvHVn(PL_incgv), filename, len, 0);
+
+if (!(svp && *svp != &PL_sv_undef)) { /* not in %INC */
+MP_TRACE_h(MP_FUNC,
+   "package %s not in %INC, attempting to load '%s'\n",
+   name, filename);
+
+if (modperl_require_module(aTHX_ name, FALSE)) {
+MP_TRACE_h(MP_FUNC, "loaded %s package\n", name);
+}
+else {
+MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
 return 0;
 }
 }
 else {
-MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name);
-return 0;
+MP_TRACE_h(MP_FUNC, "package %s seems to be loaded\n"
+   "  $INC{%s)='%s';\n",
+   name, filename, SvPV_nolen(*svp));
 }
 }
-
+
+/* try to lookup the stash only after loading the module, to avoid
+ * the case where a stash is autovivified by a user before the
+ * module was loaded, preventing from loading the module
+ */
+if (!(stash || (stash = gv_stashpv(name, FALSE {
+MP_TRACE_h(MP_FUNC, "package %s seems to be loaded, "
+   "but can't find its stash\n", name);
+return 0;
+}
+
 if ((gv = gv_fetchmethod(stash, handler_name)) && (cv = GvCV(gv))) {
 if (CvFLAGS(cv) & CVf_METHOD) { /* sub foo : method {}; */
 MpHandlerMETHOD_On(handler);
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]