我刚玩过 Perl CGI 和 SQLite。我认为这样的事情可以完成这项工作。
my $res = $dbh->selectall_arrayref("SELECT name, surename, phone FROM status;"),
print $cgi->table(
$cgi->Tr(
{ -align => "CENTER", -valign => "TOP" },
$cgi->th( [ 'Name', 'Surename', 'Phone' ] )
),
foreach my $row (@$res){
( $name, $surename, $phone ) = @$row,
print $cgi->Tr( $cgi->td($name), $cgi->td($surename), $cgi->td($phone) ),
}
);
是否需要手动创建 HTML 文档的表格?