1CGI::Compile(3) User Contributed Perl Documentation CGI::Compile(3)
2
3
4
6 CGI::Compile - Compile .cgi scripts to a code reference like
7 ModPerl::Registry
8
10 use CGI::Compile;
11 my $sub = CGI::Compile->compile("/path/to/script.cgi");
12
14 CGI::Compile is an utility to compile CGI scripts into a code reference
15 that can run many times on its own namespace, as long as the script is
16 ready to run on a persistent environment.
17
18 NOTE: for best results, load CGI::Compile before any modules used by
19 your CGIs.
20
22 Combined with CGI::Emulate::PSGI, your CGI script can be turned into a
23 persistent PSGI application like:
24
25 use CGI::Emulate::PSGI;
26 use CGI::Compile;
27
28 my $cgi_script = "/path/to/foo.cgi";
29 my $sub = CGI::Compile->compile($cgi_script);
30 my $app = CGI::Emulate::PSGI->handler($sub);
31
32 # $app is a PSGI application
33
35 Tatsuhiko Miyagawa <miyagawa@bulknews.net>
36
38 Rafael Kitover <rkitover@cpan.org>
39
40 Hans Dieter Pearcey <hdp@cpan.org>
41
43 Copyright (c) 2009 Tatsuhiko Miyagawa <miyagawa@bulknews.net>
44
45 This library is free software; you can redistribute it and/or modify it
46 under the same terms as Perl itself.
47
49 ModPerl::RegistryCooker CGI::Emulate::PSGI
50
51
52
53perl v5.12.1 2010-03-10 CGI::Compile(3)