Re: [mp2] Apache::PerlSections->dump gives no output at all.
[prev]
[thread]
[next]
[Date index for 2004/11/01]
--------------enigD85EB381A9DF9E52C26D15AC
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
M.v.Buytene wrote:
> On 2004-10-28 17:34:23 +0200, "Philippe M. Chiasson"
> <gozer@xxxxxxxxx.xxx> 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
--------------enigD85EB381A9DF9E52C26D15AC
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBhnlDyzKhB4jDpaURAp4oAJ4tBe6a7Uts6dyVK4UgTNdGeqYX7wCgusdJ
8g8b/WWXeryALyr03Nkg4Ns=
=4fOn
-----END PGP SIGNATURE-----
--------------enigD85EB381A9DF9E52C26D15AC--
 |
 |
Re: [mp2] Apache::PerlSections->dump gives no output at all.
Philippe M. Chiasson 17:58 on 01 Nov 2004
|