#!/usr/bin/perl -- BEGIN{$ENV{PATH_ROUTER_DEBUG}=999;} use Path::Router; use Path::Router::Shell; use Data::Dump qw/ dd pp /; my $router = Path::Router->new; $router->add_route( '/api/action.:format' ); $router->add_route( '/ro/sham/:bo' ); my $route = '/ro/sham/json'; dd( $route => scalar( $router->match( $route ) ) ); dd( $router ); __END__ Attempting to match /api/action.:format against ro/sham/json regexp is (?:api(?:\/action.:format)) Attempting to match /ro/sham/:bo against ro/sham/json regexp is (?:ro(?:\/sham(?:\/([^\/]+)))) match success ( "/ro/sham/json", bless({ mapping => { bo => "json" }, path => "ro/sham/json", route => bless({ components => ["ro", "sham", ":bo"], defaults => {}, path => "/ro/sham/:bo", validations => {}, }, "Path::Router::Route"), }, "Path::Router::Route::Match"), ) bless({ inline => 1, match_code => sub { ... }, route_class => "Path::Router::Route", routes => [ bless({ components => ["api", "action.:format"], defaults => {}, path => "/api/action.:format", validations => {}, }, "Path::Router::Route"), bless({ components => ["ro", "sham", ":bo"], defaults => {}, path => "/ro/sham/:bo", validations => {}, }, "Path::Router::Route"), ], }, "Path::Router")