Leser: 13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use Term::Choose::Table qw( print_table ); my $table = [ [ 'id', 'name' ], [ 1, 'Ruth' ], [ 2, 'John' ], [ 3, 'Mark' ], [ 4, 'Nena' ], ]; print_table( $table ); use DBI; my $dbh = DBI->connect( ... ); my $sth = $dbh->prepare( "SELECT * FROM table" ); $sth->execute(); my $a_ref = $sth->fetchall_arrayref(); unshift @$a_ref, $sth->{NAME}; my $opt = { ... }; print_table( $a_ref, $opt );