package MyApp; use Catalyst; MyApp->action( _end => sub { my ( $self, $c ) = @_; $c->forward('MyApp::View::TT') unless $c->response->output; }, 'index.html' => sub { my ( $self, $c ) = @_; $c->stash->{template} = 'index.tt'; }, 'hello.html' => sub { my ( $self, $c ) = @_; $c->response->output('Hello Catalyst'); }, '/^product[_]*(\d*).html$/' => sub { my ( $self, $c ) = @_; $c->stash->{template} = 'product.tt'; $c->stash->{product} = $c->req->snippets->[0]; } ); 1;