Something like this:
sub {
my $ID = $_[0] || 0;
my $cat_db = $DB->table('Category');
my $sth = $cat_db->select (['ID','Name'], { FatherID => $ID });
my $output;
while (my ($id,$name) = $sth->fetchrow_array) {
$output .= qq~<a href="$CFG->{db_cgi_url}/add.cgi?ID=$id">$name</a><br>~;
}
return $output;
}
sub {
my $ID = $_[0] || 0;
my $cat_db = $DB->table('Category');
my $sth = $cat_db->select (['ID','Name'], { FatherID => $ID });
my $output;
while (my ($id,$name) = $sth->fetchrow_array) {
$output .= qq~<a href="$CFG->{db_cgi_url}/add.cgi?ID=$id">$name</a><br>~;
}
return $output;
}