sub { #Top 100 Links
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 100');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
$tags->{totalhits} + = $link->{hits};
push (@output, $link);
}
return { top100_loop => \@output };
}
there is a column called hits, i try to calculate the total hit of selected links
but i get error. is there anything wrong
or if i could use calculation in tag? such as <%hits + $hits%>?
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 100');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
$tags->{totalhits} + = $link->{hits};
push (@output, $link);
}
return { top100_loop => \@output };
}
there is a column called hits, i try to calculate the total hit of selected links
but i get error. is there anything wrong
or if i could use calculation in tag? such as <%hits + $hits%>?