my $rs = $schema->resultset('Resultset')->search( # ... ); my @data = $rs->all(); # ... $template->param('some_loop' => \@data);