Let's assume that for some reason you have to write it from scratch and re-using an existing "web message board" codebase is not an option - all you can use is well-tested CPAN modules like DBI and CGI.pm etc.
are both in the same status as CPAN modules, and are both readily available for stealing parts or just seeing "how you do it". In particular, Slashcode runs
(a high-traffic, high-visibility site), and is highly
reconfigurable: enough that you wouldn't recognize the externals.
It's perfectly OK to "reinvent wheels", presuming you study existing art first.
Please don't ask us to spoonfeed to you what these guys have already discovered. Check
out prior art first!
-- Randal L. Schwartz, Perl hacker