1 package Web::Simple::DispatchNode;
5 extends 'Web::Dispatch::Node';
7 has _app_object => (is => 'ro', init_arg => 'app_object', required => 1);
10 my ($orig, $self) = (shift, shift);
11 # this ensures that the dispatchers get called as methods of the app itself
12 my $code = $self->$orig($self->_app_object, @_);
13 # if the first argument is a hashref, localize %_ to it to permit
14 # use of $_{name} inside the dispatch sub
16 ? do { my $v = $_[0]; sub { local *_ = $v; &$code } }