handle request automatically on PLP::CGI import
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 15 Mar 2008 00:52:51 +0000 (01:52 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 17 Mar 2008 19:52:26 +0000 (20:52 +0100)
As it's not used for much else, PLP::CGI can simply start running on
import. So like PLP::FastCGI, the executable only needs to C<use PLP::CGI>
(and C<require> for advanced usage).

No backwards compatibility issues, as the last release didn't have this
modularized (PLP wrapper works the same as before).

PLP/CGI.pm
plp.cgi

index 817a5523dd4af806dd829e4750210e61e1f70b05..1f46a3c9852954a25d1fc279da38aa56dbb42b37 100644 (file)
@@ -65,11 +65,15 @@ sub read ($) {
        return $data;
 }
 
-# This is run by the CGI script. (#!perl \n use PLP::CGI; PLP::CGI::everything;)
 sub everything {
        PLP::clean();
        $_[0]->init() and PLP::start();
 }
 
+# This is run by the CGI script. (#!perl \n use PLP::CGI;)
+sub import {
+       $_[0]->everything();
+}
+
 1;
 
diff --git a/plp.cgi b/plp.cgi
index aa3b32f904ddb27e1fb424c880bc0b7e77d9bcee..0b644579c6f468bd3a41dc929937184761d14b33 100644 (file)
--- a/plp.cgi
+++ b/plp.cgi
@@ -3,7 +3,5 @@
 # This script is not installed automatically, and is not needed for mod_perl
 # installations.
 
-use PLP;
-PLP::everything();
-
+use PLP::CGI;