<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    CGI::Compile - Compile .cgi scripts to a code reference like
    ModPerl::Registry

SYNOPSIS
      use CGI::Compile;
      my $sub = CGI::Compile-&gt;compile("/path/to/script.cgi");

DESCRIPTION
    CGI::Compile is an utility to compile CGI scripts into a code reference
    that can run many times on its own namespace, as long as the script is
    ready to run on a persistent environment.

    NOTE: for best results, load CGI::Compile before any modules used by
    your CGIs.

RUN ON PSGI
    Combined with CGI::Emulate::PSGI, your CGI script can be turned into a
    persistent PSGI application like:

      use CGI::Emulate::PSGI;
      use CGI::Compile;

      my $cgi_script = "/path/to/foo.cgi";
      my $sub = CGI::Compile-&gt;compile($cgi_script);
      my $app = CGI::Emulate::PSGI-&gt;handler($sub);

      # $app is a PSGI application

CAVEATS
    If your CGI script has a subroutine that references the lexical scope
    variable outside the subroutine, you'll see warnings such as:

      Variable "$q" is not available at ...
      Variable "$counter" will not stay shared at ...

    This is due to the way this module compiles the whole script into a big
    "sub". To solve this, you have to update your code to pass around the
    lexical variables, or replace "my" with "our". See also
    &lt;http://perl.apache.org/docs/1.0/guide/porting.html#The_First_Mystery&gt;
    for more details.

AUTHOR
    Tatsuhiko Miyagawa &lt;miyagawa@bulknews.net&gt;

CONTRIBUTORS
    Rafael Kitover &lt;rkitover@cpan.org&gt;

    Hans Dieter Pearcey &lt;hdp@cpan.org&gt;

COPYRIGHT &amp; LICENSE
    Copyright (c) 2009 Tatsuhiko Miyagawa &lt;miyagawa@bulknews.net&gt;

    This library is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

SEE ALSO
    ModPerl::RegistryCooker CGI::Emulate::PSGI

</pre></body></html>