in reply to Re: Build Table with 'n' rows and 'm' columns
in thread Build Table with 'n' rows and 'm' columns

There room for a some small improvements.
use strict; use warnings; use DBI (); use HTML::TableTiler (); my $dbh = DBI->connect("DBI:mysql:project") or die "Can't connect to Oracle database: $DBI::errstr\n"; my $matrix = $dbh->selectall_arrayref("SELECT * FROM modules"); die "Unable to fetch query results: $DBI::errstr\n" if $dbh->err; my $tt = HTML::TableTiler->new(); print $tt->tile_table($matrix);

Update: I was obviously tired! Fixed the problems identified in replies.

Replies are listed 'Best First'.
Re^3: Build Table with 'n' rows and 'm' columns
by mreece (Friar) on Nov 02, 2006 at 15:07 UTC
    there is still room for some small improvement!
    Global symbol "$sth" requires explicit package name
    ;-)
      And more. Personally, I prefer using SELECT over SELET ;-)