# lib/Blog/Controller/Root.pm package Blog::Controller::Root; use strict; use warnings; use base 'Catalyst::Controller::BindLex'; __PACKAGE__->config->{namespace} = ''; sub all_posts : Path : Args(0) { my ($self, $c) = @_; my @posts : Stashed = $c->model('DBIC::Posts')->search( {}, { order_by => 'posted DESC', rows => 5, page => 1, } ); } sub end : ActionClass('RenderView') { }