X-Git-Url: http://git.shiar.net/perl/plp/.git/blobdiff_plain/ef6d542255046b6f50d7047d8e5a1d85b9f01042..96959bff080392067524996e6edbf95445ba66da:/plp.cgi diff --git a/plp.cgi b/plp.cgi index 850e305..58cb1d0 100755 --- a/plp.cgi +++ b/plp.cgi @@ -1,38 +1,7 @@ -#!/usr/local/bin/perl -use v5.6.0; -use PLP; +#!/usr/bin/env perl -die 'Wrong module version' if $PLP::VERSION ne '3.02'; +# Executable to serve PLP scripts using CGI. +# Not installed automatically, and only needed for CGI installations. -use vars qw($DEBUG); - -use strict; -{ - $PLP::code = ''; - $PLP::sentheaders = 0; - $PLP::inA = 0; - $PLP::inB = 0; - delete @ENV{ grep /^PLP_/, keys %ENV }; -} - -$DEBUG = 1; - -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;