added synopsis to Engine subclassed and documented a couple of methods to make podcov...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / CGI / NPH.pm
index dae2bb9..30f925e 100644 (file)
@@ -11,7 +11,19 @@ Catalyst::Engine::CGI::NPH - Catalyst CGI Engine
 
 =head1 SYNOPSIS
 
-See L<Catalyst>.
+A script using the Catalyst::Engine::CGI::NPH module might look like:
+
+    #!/usr/bin/perl -w
+
+    BEGIN { 
+       $ENV{CATALYST_ENGINE} = 'CGI::NPH';
+    }
+
+    use strict;
+    use lib '/path/to/MyApp/lib';
+    use MyApp;
+
+    MyApp->run;
 
 =head1 DESCRIPTION
 
@@ -30,8 +42,12 @@ This class overloads some methods from C<Catalyst::Engine::CGI>.
 sub finalize_headers {
     my $c = shift;
 
-    my $status = $c->response->status || 200;
-    printf( "%d %s\015\012", $status, HTTP::Status::status_message($status) );
+    my $protocol = $ENV{SERVER_PROTOCOL} || 'HTTP/1.0';
+    my $status   = $c->response->status || 200;
+    my $message  =  HTTP::Status::status_message($status);
+   
+    printf( "%s %d %s\015\012", $protocol, $status, $message );
+
     $c->SUPER::finalize_headers;
 }