my @tables = qw/table1 table2 table3/; foreach my $tab ( @tables ) { my $attrs = DBH->func($tab, 'table_attributes'); print $q->p, $q->strong($_), $q->start_table({BORDER=>1}), $q->TR( $q->th([qw/NAME TYPE SIZE NULLABLE DEFAULT CONSTRAINT PRIMARY_KEY/]) ); foreach my $item ( @{$attrs} ) { print $q->TR( $q->td( [ %{$item}->{NAME}, %{$item}->{TYPE}, %{$item}->{SIZE}, %{$item}->{NULLABLE}, %{$item}->{DEFAULT}, %{$item}->{CONSTRAINT}, %{$item}->{PRIMARY_KEY}, ] ) ); } print $q->end_table; }