Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

merge pod update (by markstos)

  • Loading branch information...
commit e5151576c4fb4c8653d0d83ecb40185c4c2181f0 1 parent 1774982
@kazuho authored
Showing with 16 additions and 6 deletions.
  1. +16 −6 lib/CGI/Application/Emulate/PSGI.pm
View
22 lib/CGI/Application/Emulate/PSGI.pm
@@ -60,31 +60,40 @@ CGI::Application::Emulate::PSGI - a legacy-code-friendly PSGI adapter for CGI::A
=head1 SYNOPSIS
+Create a PSGI application from a L<CGI::Application> project:
+
# if using CGI::Application
- my $app = CGI::Application::Emulate::PSGI->handler(sub {
+ my $psgi_app = CGI::Application::Emulate::PSGI->handler(sub {
my $webapp = WebApp->new();
$webapp->run();
});
# if using CGI::Application::Dispatch
- my $app = CGI::Application::Emulate::PSGI->handler(sub {
+ my $psgi_app = CGI::Application::Emulate::PSGI->handler(sub {
WebApp::Dispatch->dispatch();
});
+See L<plackup> for options for running a PSGI application.
+
=head1 DESCRIPTION
-CGI::Application::Emulate::PSGI is a runner to run L<CGI::Application> as a PSGI application. Differences from L<CGI::Application::PSGI> are:
+CGI::Application::Emulate::PSGI allows a project based on L<CGI::Application> to run as a PSGI application. Differences from L<CGI::Application::PSGI> are:
=over 4
-=item uses L<CGI.pm> instead of L<CGI::PSGI>
+=item uses L<CGI.pm> directly instead of L<CGI::PSGI>
-L<CGI::Application::PSGI> (that uses L<CGI::PSGI>) does not support programs calling L<CGI.pm> in func-style (like CGI::virtual_host()). CGI::Application::Emulate::PSGI sets up environment variables so that codes using L<CGI.pm> will work.
+L<CGI::Application::PSGI> (that uses L<CGI::PSGI>) does not support programs calling L<CGI.pm> in func-style (like CGI::virtual_host()). CGI::Application::Emulate::PSGI sets up environment variables so that code using L<CGI.pm> will work. Both approaches explictly use CGI.pm as the query object.
=item compatible with L<CGI::Application::Dispatch>
The interface of CGI::Application::Emulate::PSGI is different from L<CGI::Application::PSGI>, and is compatible with L<CGI::Application::Dispatch>.
+=item headers are parsed and re-generated.
+
+This difference is in favor of L<CGI::Application::PSGI>, which more directly generates the HTTP headers in PSGI format. This module
+requires additional processing: First CGI::Application builds the full response including the headers and body, then we parse the final result back into the header and body format called for by the PSGI spec.
+
=back
=head1 AUTHOR
@@ -98,6 +107,7 @@ it under the same terms as Perl itself.
=head1 SEE ALSO
-L<CGI::Application::PSGI>
+L<CGI::Application::PSGI>, L<CGI>
+
=cut
Please sign in to comment.
Something went wrong with that request. Please try again.