in reply to What module do you like for debugging CGI scripts

I use Devel::ptkdb (Tk debugger). It works for CGI, command line and even Catalyst applications. In case of Catalyst you have to load some modules by hand (e. g. the controller) with
perl -d:ptkdb -MMyApp::Controller::Root script/myapp_server_debug.pl