my $sth = $dbh->prepare($query); $sth->execute; $out = ''; foreach my $queryResult( $sth->fetchrow_hashref ) $out .= $mask->process( $queryResult ) } return $out; #### [% MACRO mask BLOCK %] [% END # macro block mask %] [% INCLUDE DB ## db calls macro mask, can be redefined query=' SELECT * FROM latestnews; ' %]
[% news_title %] [% news_headline %] [% WRAPPER link action = "readnews" newsitem = news_id %]Read More...[% END # block test %]