document disappearance of magic $self global
Matt S Trout [Wed, 24 Nov 2010 20:59:46 +0000 (20:59 +0000)]
lib/Web/Simple.pm

index d251cc7..86a9cbd 100644 (file)
@@ -527,6 +527,7 @@ subdispatch fails.
 dispatch {} has gone away - instead, you write:
 
   sub dispatch_request {
+    my $self = shift;
     sub (GET /foo/) { ... },
     ...
   }
@@ -534,6 +535,14 @@ dispatch {} has gone away - instead, you write:
 Note that this method is still -returning- the dispatch code - just like
 dispatch did.
 
+Also note that you need the 'my $self = shift' since the magic $self
+variable went away.
+
+=item * the magic $self variable went away.
+
+Just add 'my $self = shift;' while writing your 'sub dispatch_request {'
+like a normal perl method.
+
 =item * subdispatch deleted - all dispatchers can now subdispatch
 
 In earlier releases you needed to write: