correct POD on ** match
[catagits/Web-Simple.git] / lib / Web / Simple.pm
index b37ca27..db83535 100644 (file)
@@ -6,7 +6,7 @@ use warnings::illegalproto ();
 use Moo ();
 use Web::Dispatch::Wrapper ();
 
-our $VERSION = '0.009';
+our $VERSION = '0.011';
 
 sub import {
   my ($class, $app_package) = @_;
@@ -61,6 +61,10 @@ you'll get the "Hello world!" string output to your browser. At the same time
 this file will also act as a class module, so you can save it as HelloWorld.pm
 and use it as-is in test scripts or other deployment mechanisms.
 
+Note that you should retain the ->run_if_script even if your app is a
+module, since this additionally makes it valid as a .psgi file, which can
+be extremely useful during development.
+
 For more complex examples and non-CGI deployment, see
 L<Web::Simple::Deployment>. To get help with L<Web::Simple>, please connect to
 the irc.perl.org IRC network and join #web-simple.
@@ -194,6 +198,17 @@ However, generally, instead of that, you return a set of dispatch subs:
     ...
   }
 
+Well, a sub is a valid PSGI response too (for ultimate streaming and async
+cleverness). If you want to return a PSGI sub you have to wrap it into an
+array ref.
+
+  sub dispatch_request {
+    [ sub { 
+        my $respond = shift;
+        # This is pure PSGI here, so read perldoc PSGI
+    } ]
+  }
+
 If you return a subroutine with a prototype, the prototype is treated
 as a match specification - and if the test is passed, the body of the
 sub is called as a method any matched arguments (see below for more details).
@@ -307,9 +322,9 @@ also match more than one part:
 and so on. To match an arbitrary number of parts, use -
 
   sub (/page/**) {
+    my ($self, $match) = @_;
 
-This will result in an element per /-separated part so matched. Note that
-you can do
+This will result in a single element for the entire match. Note that you can do
 
   sub (/page/**/edit) {
 
@@ -691,7 +706,7 @@ John Napiorkowski (jnap) <jjn1056@yahoo.com>
 
 Josh McMichael <jmcmicha@linus222.gsc.wustl.edu>
 
-Justin Hunter <justin.d.hunter@gmail.com>
+Justin Hunter (arcanez) <justin.d.hunter@gmail.com>
 
 Kjetil Kjernsmo <kjetil@kjernsmo.net>
 
@@ -705,7 +720,7 @@ Robin Edwards <robin.ge@gmail.com>
 
 =head1 COPYRIGHT
 
-Copyright (c) 2010 the Web::Simple L</AUTHOR> and L</CONTRIBUTORS>
+Copyright (c) 2011 the Web::Simple L</AUTHOR> and L</CONTRIBUTORS>
 as listed above.
 
 =head1 LICENSE