Something like this
sub {
# Displays the newest links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 5');
$sth = $search_db->select ( { isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
$link->{category} = $DB->table('CatLinks','Category')->select(['Full_Name'],{LinkID => $link->{ID}});
if (length $link->{Description} > 220) {
$link->{Description} = substr($link->{Description}, 0, 220) . '...';
}
$output .= Links::SiteHTML::display ('new_links', $link);
}
return $output;
}
sub {
# Displays the newest links on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 5');
$sth = $search_db->select ( { isValidated => 'Yes' });
while ($link = $sth->fetchrow_hashref) {
$link->{category} = $DB->table('CatLinks','Category')->select(['Full_Name'],{LinkID => $link->{ID}});
if (length $link->{Description} > 220) {
$link->{Description} = substr($link->{Description}, 0, 220) . '...';
}
$output .= Links::SiteHTML::display ('new_links', $link);
}
return $output;
}