X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FWeb%2FSimple%2FDispatchNode.pm;h=3f37c05e01734cfcae64930afe3debc0419f0a08;hb=bfa343454601d018d8ae9d2f3cf9137616c79a8c;hp=36e5e6760cc8d9661e2ac523ed4276693af79624;hpb=1d2f4b67ca3f3dedd1a9a1863cee2b01a446baaa;p=catagits%2FWeb-Simple.git diff --git a/lib/Web/Simple/DispatchNode.pm b/lib/Web/Simple/DispatchNode.pm index 36e5e67..3f37c05 100644 --- a/lib/Web/Simple/DispatchNode.pm +++ b/lib/Web/Simple/DispatchNode.pm @@ -9,7 +9,10 @@ has _app_object => (is => 'ro', init_arg => 'app_object', required => 1); # this ensures that the dispatchers get called as methods of the app itself around _curry => sub { my ($orig, $self) = (shift, shift); - $self->$orig($self->_app_object, @_); + my $code = $self->$orig($self->_app_object, @_); + ref($_[0]) eq 'HASH' + ? do { my $v = $_[0]; sub { local *_ = $v; &$code } } + : $code }; 1;