use DBI; use HTML::Template; my $dbh = DBI->connect( "DBI:SQLite:sqlite_db" ); my $table = 'my_sqlite_table'; # vorher ausgewählter table my $sth = $dbh->prepare( "SELECT * FROM $table" ); $sth->execute(); my @col = @{$sth->{NAME}}; $dbh->disconnect; # column.html my $html = qq{


}; my $tmpl = HTML::Template->new( scalarref => \$html ); my @columns; for my $c ( @col ) { push @columns, { COLUMN => $c } } $tmpl->param( COLUMNS => \@columns ); open my $fh, '>', 'columns.html' or die $!; $tmpl->output( print_to => $fh ); close $fh;