on a separate note..if memory serves correctly..there's a standard way to interrogate the database schema via DBI, rather than getting the information indirectly. please have a look at DBI Catalog Methods
the hardest line to type correctly is: stty erase ^H