It is taking forever to creating a HTML table (sometimes there is a
not-enough memory error).
The steps are simple from a DBI handle. Create a TD for each field and
a TR for each record.
my @fieldNames = qw(foo bar foobar foofoo barbar foofoobar);
my $row,$tbody,$tfoot;
# Create THEAD/TFOOT
...
#
# Create TBODY
foreach my $primary_key ($recordset_hashref)
{
$row = '';
foreach my $field (@fieldNames){
$row .= td({-class=>"foo-class bar-class foobar-class"},
$recordset_hashref->{$field});
}
$tbody .= Tr($row);
}
print
table({-id=>"cgi-created-table"},thead($thead),tfoot($tfoot),tbody($tbody));
When the table is large for an HTML page (eg ~1k records), this hangs a
few seconds. Someone on Perlmonks noted that it might be recursively
copying the created string, which seems inefficient.