v3.03 release
[perl/plp/.git] / plp.cgi
1 #!/usr/local/bin/perl
2 use v5.6.0;
3 use PLP;
4
5 die 'Wrong module version' if $PLP::VERSION ne '3.03';
6
7 use vars qw($DEBUG);
8
9 use strict;
10 {
11     $PLP::code = '';
12     $PLP::sentheaders = 0;
13     $PLP::inA = 0;
14     $PLP::inB = 0;
15     delete @ENV{ grep /^PLP_/, keys %ENV };
16 }
17
18 $DEBUG = 1;
19
20 PLP::start();
21
22 {
23     no strict;
24     PLP::Fields::doit();
25     {
26         package PLP::Script;
27         *headers = \%header;
28         *cookies = \%cookie;
29         PLP::Functions->import();
30         # No lexicals may exist at this point.
31         eval qq{package PLP::Script; $PLP::code};
32     }
33     PLP::error($@, 1) if $@;
34     select STDOUT;
35     undef *{"PLP::Script::$_"} for keys %PLP::Script::;
36     PLP::sendheaders() unless $PLP::sentheaders;
37 }
38