And add to your literature some templating solutions: CGI may be the bones of your web-application, templating modules will be the meat on those bones.
Two of the best templating modules are: Template::Toolkit and HTML::Template
Once you have digested the basics of CGI and templating, why not leverage this knowledge one level higher and look at full blown web-frameworks such as Catalyst or CGI::Application?
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James