It is possible to run CGI scripts through the debugger (perl -d) - I can't remember what I did the last time to make that work throughout the script, but cgi methods simply output html to STDOUT instead of the browser if you do that. A bit of tweaking of values using the debugger may be needed to fake input from the user and the browser environment in most cases. Or in worst cases, you can create an override package called DEBUGCGI that inherits from CGI and overrides methods and tweaks values as necessary and use that instead.