Web-Dispatcher-Simple

 view release on metacpan or  search on metacpan

lib/Web/Dispatcher/Simple.pm  view on Meta::CPAN

    no strict 'refs';
    no warnings 'redefine';

    *{"${caller}::router"} = \&router;

    my @http_methods = qw/get post put del any/;
    for my $http_method (@http_methods) {
        *{"${caller}\::$http_method"} = sub { goto \&$http_method };
    }

    strict->import;
    warnings->import;
}

sub _stub {
    my $name = shift;
    return sub { Carp::croak("Can't call $name() outside router block") };
}

{
    my @declarations = qw(get post put del any);



( run in 0.722 second using v1.01-cache-2.11-cpan-299005ec8e3 )