in reply to perl debugger

Have a look at Devel::ptkdb, the Tk-Debugger by Andrew Page.

How you can use it to debug cgi-scripts is explained in the documentation and in toma's note: Debugging a CGI.