You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "M.v.Buytene" <ma...@regex.nl> on 2004/10/28 11:08:37 UTC

[mp2] Apache::PerlSections->dump gives no output at all.

I'm quit puzzled here....

I use mod_perl to perform some database lookups from my httpd.conf and 
build up all directives
and create all vhost's.
That part works ok, apache works with the vhosts like a charm.... 
but.... always a but... :)

When i use the Apache::PerlSections->dump(); i only see

1;
__END__

when reloading/starting/stopping apache, and i wish to see my complete 
vhosts dumped.

Am i completetly missing the point of Apache::PerlSections->dump, or am 
i doing something completly wrong?

Using mod perl 1.99_17


Martijn



-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] Apache::PerlSections->dump gives no output at all.

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
M.v.Buytene wrote:
> On 2004-10-28 17:34:23 +0200, "Philippe M. Chiasson" 
> <go...@ectoplasm.org> said:
>>M.v.Buytene wrote:
>>
>> [...]
>>>When i use the Apache::PerlSections->dump(); i only see
>>>
>>>1;
>>>__END__
>>

The problem is now clear to me. The <Perl> section handling in mod_perl 2,
even though it's mostly backwards compatible with the way thing worked in 1.x,
is significantly different.

This is a good example of it. The way processing of <Perl> sections is
now done thru handlers, just like the rest of mod_perl. In this case, the call
to Apache::PerlSections->dump() is performed at code evaluation time, _before_
the PerlSection handler is handed the parsed <Perl> section. This will be
documented shortly.

But to fix your problem, the rule is simple. Put your code in <Perl> blocks and
make sure to set $Apache::PerlSections::Save = 1. Then in *another* <Perl> block
do your Apache::PerlSections->dump() call. So for instance:

<Perl>
   $Apache::PerlSections::Save = 1;
   [...]
</Perl>

<Perl>
   print STDERR Apache::PerlSections->dump();
</Perl>

Or if you don't like the one-liner <Perl> block, you can also use the Perl directive
for one-liners:

   Perl print STDERR Apache::PerlSections->dump();

Either way, I'll be changing the documentation to make this clear.
-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Re: [mp2] Apache::PerlSections->dump gives no output at all.

Posted by "M.v.Buytene" <ma...@regex.nl>.
On 2004-10-28 17:34:23 +0200, "Philippe M. Chiasson" 
<go...@ectoplasm.org> said:

> 
> M.v.Buytene wrote:
>> I'm quit puzzled here....
>> 
>> I use mod_perl to perform some database lookups from my httpd.conf and 
>> build up all directives
>> and create all vhost's.
>> That part works ok, apache works with the vhosts like a charm.... 
>> but.... always a but... :)
> 
> How exactly do you build and create all these vhosts ? Can you post
> a sample of it?

When my debugging works i will post a complete document.

> 
>> When i use the Apache::PerlSections->dump(); i only see
>> 
>> 1;
>> __END__
> 
> My best guess for now is that you forgot to set
> 
> $Apache::PerlSections::Save = 1;
> 
> in your <Perl> blocks. See
> http://perl.apache.org/docs/2.0/api/Apache/PerlSections.html#C__Apache__PerlSections__Save_
for 
> 
> for more info.

Still a no go.... it just gives me

1;
__END__

And there is not much to find at the documents you pointed me to.

Even when i use 'normal' style directives it gives the same.... with
normal style i mean :

        $Directory{"/usr/local/apache2/htdocs/test_case_2"} = {
        Options => 'FollowSymlinks',
        AllowOverride => 'All',
        Limit => {
         'GET PUT POST' => {
         require => 'valid-user',
         Order => 'allow,deny',
         Allow => 'from all',
             },
    },
};


> 
>> when reloading/starting/stopping apache, and i wish to see my complete 
>> vhosts dumped.
>> 
>> Am i completetly missing the point of Apache::PerlSections->dump, or am 
>> i doing something completly wrong?
>> 
>> Using mod perl 1.99_17
>> 
>> Martijn




-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Re: [mp2] Apache::PerlSections->dump gives no output at all.

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
M.v.Buytene wrote:
> I'm quit puzzled here....
> 
> I use mod_perl to perform some database lookups from my httpd.conf and 
> build up all directives
> and create all vhost's.
> That part works ok, apache works with the vhosts like a charm.... 
> but.... always a but... :)

How exactly do you build and create all these vhosts ? Can you post
a sample of it?

> When i use the Apache::PerlSections->dump(); i only see
> 
> 1;
> __END__

My best guess for now is that you forgot to set

$Apache::PerlSections::Save = 1;

in your <Perl> blocks. See
http://perl.apache.org/docs/2.0/api/Apache/PerlSections.html#C__Apache__PerlSections__Save_
for more info.

> when reloading/starting/stopping apache, and i wish to see my complete 
> vhosts dumped.
> 
> Am i completetly missing the point of Apache::PerlSections->dump, or am 
> i doing something completly wrong?
> 
> Using mod perl 1.99_17
> 
> Martijn

-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5