I would use a loop.
sub {
my ($rec) = @_;
my $name = $rec->{Username};
my $db = $DB->table ('Links');
my $sth = $db->select ( { 'LinkOwner' => $name });
my @links;
while (my $link = $sth->fetchrow_hashref){
push @links, $link;
}
return {Link_Loop=>\@links};
}
Then where you want the listings you can put
<%globalname%> - (whatever you call the global above)
<%loop Link_Loop%>
-----------
Listing # <%row_num%>
-----------
Title :: <%Title%>
Description :: <%Description%>
URL :: <%URL%>
Operating System :: <%OS%>
<%endloop%>
sub {
my ($rec) = @_;
my $name = $rec->{Username};
my $db = $DB->table ('Links');
my $sth = $db->select ( { 'LinkOwner' => $name });
my @links;
while (my $link = $sth->fetchrow_hashref){
push @links, $link;
}
return {Link_Loop=>\@links};
}
Then where you want the listings you can put
<%globalname%> - (whatever you call the global above)
<%loop Link_Loop%>
-----------
Listing # <%row_num%>
-----------
Title :: <%Title%>
Description :: <%Description%>
URL :: <%URL%>
Operating System :: <%OS%>
<%endloop%>