May someone can change this to an easier way, plz ?
my ($output, $url);
my $count = '0';
foreach my $cat(@cats) {
if ($count eq '0'){
$url = $cat_db->as_url($cat);
}
elsif ($count eq '1'){
$output .= qq~<a href="$url">$cat</a>~;
}
elsif ($count eq '2'){
$output .= qq~ ($cat)<br>~;
}
$count++;
if ($count eq '3') {$count = 0};
}
Robert
Code:
my @cats = $cat_db->select (['Full_Name','Name','Number_of_Links'], { FatherID => $id })->fetchall_list; my ($output, $url);
my $count = '0';
foreach my $cat(@cats) {
if ($count eq '0'){
$url = $cat_db->as_url($cat);
}
elsif ($count eq '1'){
$output .= qq~<a href="$url">$cat</a>~;
}
elsif ($count eq '2'){
$output .= qq~ ($cat)<br>~;
}
$count++;
if ($count eq '3') {$count = 0};
}
Robert