my $sql = "SELECT * FROM db50"; my $sth = $dbh->prepare ( $sql ) || die "Kann Satement nicht vorbereiten: $DBI::errstr\n"; $sth->execute() or die $dbh->errstr(); my $template = HTML::Template->new(filename => 'test2.html'); my @ergebnisse while(my @result = $sth->fetchrow_array()){ $result[2] = ''.$result[2].'' if($result[2] == 4); my %hash = ( ID => $result[0], NAME => $result[1], CAT => $result[2],); push(@ergebnisse,\%hash); } $template->param(ABFRAGE => \@ergebnisse);