in reply to Flow control / case structure
CGI::Application provides a framework for tackling this very problem.