rewrite documentation of mod_perl as the only persistent backend
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 2 Jun 2008 08:10:52 +0000 (08:10 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 2 Jun 2008 08:18:42 +0000 (08:18 +0000)
Update docs to reflect the multiple persistent backends (mod_perl was
mentioned specifically where FastCGI now qualifies as well).

README
lib/PLP.pm
lib/PLP/FAQ.pod

diff --git a/README b/README
index 17e11ffefa38566a668f0175a4cd7ecc6b8cdd77..0f057ebf98639945e5630db67af9d8b08e991331 100644 (file)
--- a/README
+++ b/README
@@ -3,8 +3,8 @@ PLP - PERL IN HTML PAGES
 PLP is yet another Perl embedder, primarily for HTML documents. Unlike
 with other Perl embedders, there is no need to learn a meta-syntax or
 object model: one can just use the normal Perl constructs. PLP runs
-under mod_perl for speeds comparable to those of PHP, but can also be
-run as a CGI script.
+under FastCGI and mod_perl for speeds comparable to those of PHP, but
+can also be run as a standard CGI script.
 
 INSTALLATION
 
index 2c6d7142d320b5969f8928224fb5a60372ae5182..7cb8d5551f8a7c8b46e26d769aff8fbf3cbaf6d0 100644 (file)
@@ -407,8 +407,9 @@ These are described in L<PLP::Fields>.
 Not only syntax is important, you should also be aware of some other important
 features. Your script runs inside the package C<PLP::Script> and shouldn't
 leave it. This is because when your script ends, all global variables in the
-C<PLP::Script> package are destroyed, which is very important if you run under
-mod_perl (they would retain their values if they weren't explicitly destroyed).
+C<PLP::Script> package are destroyed, which is very important if you run a
+persistent backend (they would retain their values if they weren't explicitly
+destroyed).
 
 Until your first output, you are printing to a tied filehandle C<PLPOUT>. On
 first output, headers are sent to the browser and C<STDOUT> is selected for
@@ -420,13 +421,13 @@ line your output started. An alternative way of setting headers is using Perl's
 BEGIN blocks. BEGIN blocks are executed as soon as possible, before anything
 else.
 
-Because the interpreter that mod_perl uses never ends, C<END { }> blocks won't
-work properly. You should use C<PLP_END { };> instead. Note that this is a not
-a built-in construct, so it needs proper termination with a semi-colon (as do
-C<eval> and C<do>).
+Unless you're running as CGI, the interpreter won't exit after processing a page,
+so C<END { }> blocks won't work properly.  You should use C<PLP_END { };> instead.
+Note that this is a not a built-in construct, so it needs proper termination
+with a semi-colon (as do C<eval> and C<do>).
 
-Under mod_perl, modules are loaded only once. A good modular design can improve
-performance because of this, but you will have to B<reload> the modules
+When run persistently, modules are loaded only once. A good modular design can
+improve performance because of this, but you will have to B<reload> the modules
 yourself when there are newer versions. 
 
 The special hashes are tied hashes and do not always behave the way you expect,
index 7496f54157658595246b9ade68ed515fe939fa1c..0630edb64257c68f7f5c50666ead33bf32e98144 100644 (file)
@@ -38,10 +38,11 @@ long as you do not switch packages).
 
 =item How can I make PLP faster?
 
-With mod_perl, PLP is a lot faster than with CGI. CGI scripts execute an
-external interpreter, but mod_perl is a Perl interpreter inside Apache.
+With mod_perl or FastCGI, PLP is a lot faster than with CGI.
+Instead of executing a new perl process for each request, the same interpreter
+will serve multiple pages.
 
-=item I already use mod_perl, can I make my scripts even faster?
+=item I already run persistently, can I make my scripts even faster?
 
 Well, you already have scripts that probably are faster than PHP equivalents,
 but speed maniacs always want more. Modules are cached, so with a proper module
@@ -78,15 +79,15 @@ B<before> the code is executed (at compile-time).
 
 =item Why do my C<END> blocks never get executed?
 
-If they are not, you are probably running under mod_perl. The blocks are
-executed when the interpreter stops, but the mod_perl interpreter is not exited
-after the PLP script has ended. Use C<PLP_END> blocks instead. Please note that
-C<PLP_END> is a normal statement, so you may need a semicolon.
+These blocks are executed when the interpreter stops, which only occurs if you
+are running as CGI.  To catch the exit of a PLP script, use C<PLP_END> blocks instead.
+Please note that C<PLP_END> is a normal statement, so you may need a semicolon.
 
     <html><body>
     <: PLP_END { :>
         </body></html>
     <: } :>
+    contents
 
 =item Can I disable the error messages?