use Data::Dumper; sub make_form_fields { my ( $dbh, $table ) = @_; my $sth = $dbh->prepare (qq{ DESCRIBE ?; }); my $table_info = $dbh->selectall_arrayref($sth, $ATTR, $table); # then parse that structure to get info and turn it into an array of field objects # NOT NULL would set a required flag # DEFAULT value would drop into same for field and so on # I haven't written the parsing, just playing still so a cop out... return = "
", Dumper($table), "\n"; }