What does this have to do with recommending the CGI module for GUI development?
For clarification, I and (I suspect tobyink) are curious about the suggestion of CGI for GUI development. Firstly OP hasn't been very clear on what they want to do (for example the title speaks of GUI automation yet the question suggests they're looking to develop a GUI rather than automate it), on which platform, is a web server even involved etc. CGI IMHO isn't best suited to GUI development, at best I'd suggest using it with some sort of templating system (Template, HTML::Template etc). This allows the separation of Perl code from the HTML(/CSS/JS).