You don't need *any* modules to do this sort of thing. Just structure your code so you have one section that displays output and another section that decides what to output and a third section to link the two.
However there are several modules that make this sort of thing easier. My current favorites are
CGI::Application and
HTML::Template. HTML::Template is a basic, but extremely fast and well designed templating engine that takes basic templates and fills them with paramaters. CGI::Application is a parent class that makes designing CGI state machines much simpler. Together they let you design clean, well structured code, so that each portion focuses on one specific task.
CGI::Applications work by having several "run modes", which basically states in your state machine, if you think of it that way. Typically every page that is displayed to a user is a run mode, and typically these run modes invoke html::template for the actual html generation. In this case, the specific run mode is the "Model" code, while the template you are displaying is the "View" code, and the CGI::Application base class provides the "Controller" code.