You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by st...@apache.org on 2004/12/15 03:40:32 UTC

svn commit: r111918 - /perl/modperl/docs/trunk/src/docs/2.0/api/Apache/PerlSections.pod

Author: stas
Date: Tue Dec 14 18:40:30 2004
New Revision: 111918

URL: http://svn.apache.org/viewcvs?view=rev&rev=111918
Log:
clarify the issue with $Apache::PerlSections::Save (input from gozer)

Modified:
   perl/modperl/docs/trunk/src/docs/2.0/api/Apache/PerlSections.pod

Modified: perl/modperl/docs/trunk/src/docs/2.0/api/Apache/PerlSections.pod
Url: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/2.0/api/Apache/PerlSections.pod?view=diff&rev=111918&p1=perl/modperl/docs/trunk/src/docs/2.0/api/Apache/PerlSections.pod&r1=111917&p2=perl/modperl/docs/trunk/src/docs/2.0/api/Apache/PerlSections.pod&r2=111918
==============================================================================
--- perl/modperl/docs/trunk/src/docs/2.0/api/Apache/PerlSections.pod	(original)
+++ perl/modperl/docs/trunk/src/docs/2.0/api/Apache/PerlSections.pod	Tue Dec 14 18:40:30 2004
@@ -141,11 +141,36 @@
 
 =head2 C<$Apache::PerlSections::Save>
 
-By default, the namespace in which C<E<lt>Perl E<gt>> 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
-C<L<Apache::Status|docs::2.0::api::Apache::Status>>.
+Each C<E<lt>PerlE<gt>> section is evaluated in its unique namespace,
+by default residing in a sub-namespace of C<Apache::ReadConfig::>,
+therefore any local variables will end up in that namespace. For
+example if a C<E<lt>PerlE<gt>> section happened to be in file
+F</tmp/httpd.conf> starting on line 20, the namespace:
+C<Apache::ReadConfig::tmp::httpd_conf::line_20> will be used. Now if
+it had:
+
+  <Perl>
+    $foo     = 5;
+    my $bar  = 6;
+    $My::tar = 7;
+  </Perl>
+
+The local global variable C<$foo> becomes
+C<$Apache::ReadConfig::tmp::httpd_conf::line_20::foo>, the other
+variable remain where they are.
+
+By default, the namespace in which C<E<lt>PerlE<gt>> sections are
+evaluated is cleared after each block closes. In our example nuking
+C<$Apache::ReadConfig::tmp::httpd_conf::line_20::foo>, leaving the
+rest untouched.
+
+By setting C<$Apache::PerlSections::Save> to a true value, the content
+of those namespaces will be preserved and will be available for
+inspection by C<L<Apache::Status|docs::2.0::api::Apache::Status>> and
+C<L<Apache::PerlSections-E<gt>dump|/C_Apache__PerlSections_E_gt_dump_>>
+In our example C<$Apache::ReadConfig::tmp::httpd_conf::line_20::foo>
+will still be accessible from other perl code, after the
+C<E<lt>PerlE<gt>> section was parsed.
 
 
 
@@ -155,7 +180,7 @@
 
 
 
-=head2 Apache::PerlSections-E<gt>dump
+=head2 C<Apache::PerlSections-E<gt>dump>
 
 This method will dump out all the configuration variables mod_perl
 will be feeding to the apache config gears. The output is suitable to
@@ -235,7 +260,7 @@
 
 
 
-=head2 Apache::PerlSections-E<gt>store
+=head2 C<Apache::PerlSections-E<gt>store>
 
 This method will call the C<dump> method, writing the output
 to a file, suitable to be pulled in via C<require> or C<do>.

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org