return to $self by following the upgrade instructions in the docs
Matt S Trout [Thu, 25 Nov 2010 20:40:16 +0000 (20:40 +0000)]
examples/bloggery/bloggery.cgi
t/sub-dispatch-args.t

index 9a5c945..b315b44 100755 (executable)
@@ -85,17 +85,18 @@ sub post {
 }
 
 sub dispatch_request {
+  my $self = shift;
   sub (GET + /) {
-    $_[0]->redispatch_to('/index.html');
+    redispatch_to '/index.html';
   },
   sub (.html) {
-    response_filter { $_[0]->render_html($_[1]) },
+    response_filter { $self->render_html($_[1]) },
   },
   sub (GET + /index) {
-    $_[0]->post_list
+    $self->post_list
   },
   sub (GET + /*) {
-    $_[0]->post($_[1])
+    $self->post($_[1])
   },
   sub (GET) {
     [ 404, [ 'Content-type', 'text/plain' ], [ 'Not found' ] ]
index 781fbf4..c7b5830 100644 (file)
@@ -13,19 +13,20 @@ use Test::More (
     package t::Web::Simple::SubDispatchArgs;
 
     sub dispatch_request {
+        my $self = shift;
         sub (/) {
-            $_[0]->show_landing(@_);
+            $self->show_landing(@_);
         },
         sub(/...) {
             sub (GET + /user) {
-                $_[0]->show_users(@_);
+                $self->show_users(@_);
             },
             sub (/user/*) {
                 sub (GET) {
-                    $_[0]->show_user(@_);
+                    $self->show_user(@_);
                 },
                 sub (POST + %:id=&:@roles~) {
-                    $_[0]->process_post(@_);
+                    $self->process_post(@_);
                 }
             },
         }