move backend interface modules into PLP::Backend:: namespace
[perl/plp/.git] / plp.cgi
diff --git a/plp.cgi b/plp.cgi
index e9961f6511ef4d7669b3abce5b77a3967ce048c4..58cb1d07fbe98dce22a9ce6b3dfecc96484df730 100755 (executable)
--- a/plp.cgi
+++ b/plp.cgi
@@ -1,35 +1,7 @@
-#!/usr/local/bin/perl
-use v5.6.0;
-use PLP;
-use strict;
+#!/usr/bin/env perl
 
-die 'Wrong module version' if $PLP::VERSION ne '3.04';
+# Executable to serve PLP scripts using CGI.
+# Not installed automatically, and only needed for CGI installations.
 
-{
-    $PLP::code = '';
-    $PLP::sentheaders = 0;
-    $PLP::inA = 0;
-    $PLP::inB = 0;
-    $PLP::DEBUG = 1;
-    delete @ENV{ grep /^PLP_/, keys %ENV };
-}
-
-PLP::start();
-
-{
-    no strict;
-    PLP::Fields::doit();
-    {
-       package PLP::Script;
-       *headers = \%header;
-       *cookies = \%cookie;
-       PLP::Functions->import();
-       # No lexicals may exist at this point.
-       eval qq{package PLP::Script; $PLP::code};
-    }
-    PLP::error($@, 1) if $@;
-    select STDOUT;
-    undef *{"PLP::Script::$_"} for keys %PLP::Script::;
-    PLP::sendheaders() unless $PLP::sentheaders;
-}
+use PLP::Backend::CGI;