I think the Perl web infrastructure with most routing like Rails will be Mojolicious
The creator Mojoliciouswrote an excellent blog entry called “Mannequin Manager,” comparing the main Perl, Ruby, and Python framework web pages and emphasizing that he thought there were improvements he made with routing to Mojolicious.
Unfortunately, the above posts are no longer online :( Instead you need to agree to the documentation Mojolicious::Guides::Routing. Here is an example of routing from the docs:
package MyApp;
use base 'Mojolicious';
sub startup {
my $self = shift;
my $r = $self->routes;
$r->route('/welcome')->to(controller => 'foo', action => 'welcome');
}
1;
There are also other Perl frameworks that provide a direct URL for routing actions:
A more complete list of Perl web frameworks can be found on the Perl5 wiki
, Plack ( . PSGI wikipedia). , Rack Ruby WSGI Python.
Plack:
use 5.012;
use warnings;
my $app = sub {
my $env = shift;
given ($env->{PATH_INFO}) {
return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Baz!' ] ]
when '/hello/baz';
default {
return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello World' ]];
}
}
}
plackup above_script.psgi .