1 package Web::Dispatch::Wrapper;
6 our @EXPORT = qw(dispatch_wrapper redispatch_to response_filter);
8 sub dispatch_wrapper (&) {
10 __PACKAGE__->from_code($code);
14 my ($class, $code) = @_;
15 bless(\$code, $class);
20 __PACKAGE__->from_code(sub {
21 $_[1]->({ %{$_[0]}, PATH_INFO => $new_path });
25 sub response_filter (&) {
27 __PACKAGE__->from_code(sub {
28 my @result = $_[1]->($_[0]);
40 sub { $code->($_[0], $app) }