Stas Bekman wrote:
colin_e wrote:

Good stuff. Thanks for such a quick and helpful reply Stas.

The piece in the docs that had me confused was in the document
"Apache::PerlSections - Default Handler for Perl sections"
(http://perl.apache.org/docs/2.0/api/Apache/PerlSections.html#C__Apache__PerlSections__Save_).


This says:

> By default, the namespace in which |<Perl >| sections are evaluated is cleared
> after each block closes. By setting it to a true value, the content of those
> namespaces will be preserved and will be available for inspection by modules
> like |Apache::Status <http://perl.apache.org/docs/2.0/api/Apache/Status.html>|.

My grasp of perl is limited, "clearing a namespace" sounds to me like something goes
away. At this point i'm not entirely clear what, but i'm glad I have an answer to work
with.

Good question. Philippe wrote this part. Philippe, could you please expand that section with some examples explaining what's exactly happening? I agree that it's quite vague and I'm not sure what did you mean there myself.

It means that if in a <Perl> section you do something like :

<Perl>
$foo = "bar";
$Some::Global::var = 123;
Something->init($foo);
</Perl>

That once this code has been run, $foo goes away. As with the example of using
'use lib' to push tings into @INC, that's pefectly safe. Only the code (and 
vars)
local to the block of <Perl> gets flushed. $Some::Global::var would survive, for
instance.

--------------------------------------------------------------------------------
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

Attachment: signature.asc
Description: OpenPGP digital signature



Reply via email to