in reply to CGI::Application: how to debug?

Taking your application out of CGI::Application (skinny run modes) might be worth a look. It takes a bit of setting up but, imo, everything gets a lot easier.