Seriously seriously consider CountZero's brief but pointed advice. Catalyst can make this sort of thing not just easy - but also <gulp> fun?!. I have toyed about with CGI::Application and it's magical variants - Catalyst works and works Nice! Get to grips with Class::DBI or DBIx::Class and you can write these sort of throwaways in your sleep. Catalyst helpers will write half of it for you.
I should explain that whilst on the mailing list and using catalyst on several of my projects , I am not affiliated or related to the Catalyst team.
I can't believe it's not psellchecked