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