From: Matt S Trout Date: Wed, 24 Nov 2010 20:59:46 +0000 (+0000) Subject: document disappearance of magic $self global X-Git-Tag: v0.005~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FWeb-Simple.git;a=commitdiff_plain;h=e41225325bb4973e3355c6826d3b8bce288592a0 document disappearance of magic $self global --- diff --git a/lib/Web/Simple.pm b/lib/Web/Simple.pm index d251cc7..86a9cbd 100644 --- a/lib/Web/Simple.pm +++ b/lib/Web/Simple.pm @@ -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: