I'm surprised noone mentioned
Apache::ASP yet, it is quite good, despite being associated with M$ ASP technology, works with mod_perl under Apache, and as CGI on other servers,
and your code is easily portable to IIS(hehe).
I usually use DBI and DBI::Pg, but lately I'm thinking about moving out of this whole SQL business, take a look at cpan::DBM::Deep