in reply to SQL to HTML cross-table code critique
Before committing anything to CPAN, have a look at:
Jack