package Maypole::View::Mason; use base 'Maypole::View::Base'; use HTML::Mason; use Maypole::Constants; sub template { my ($self, $r) = @_; my $label = "path0"; my $output; my $mason = HTML::Mason::Interp->new( comproot => [ map { [ $label++ => $_ ] } $self->paths($t) ], output_method => \$output, error_mode => "output" # Saves us having to handle them... ); $mason->exec($r->template, $self->vars($r)) $r->{output} = $output; return OK; } 1; =head1 NAME Maypole::View::Mason - A HTML::Mason view class for Maypole =head1 SYNOPSIS BeerDB->config->{view} = "Maypole::View::Mason"; And then: <%args> @breweries %args> % for my $brewery (@breweries) { ...