How to connect a debugger to Dancer2 application

Please bear with me, because I do not know about Dancer2 in the first place, except that I inherited something written with it.

I want to attach a regular debugger to it, and it bravely resists most of my attempts.

Say I have:

package Wharrgarbl; use Dancer2; # lots of stuff get '/wharrgarbl/:potato' => sub { use DB; $DB::single = 1; # probably too much code here } 

And I want to be able to attach a debugger to this response handler. How to fill this spell?

 perl -d -I wharrgarbl/lib -MWharrgarbl -E 'Wharrgarbl->???("/wharrgarbl/fnorb")' 
+5
source share
1 answer

I assume your Dancer2 application is starting via plackup, for example. plackup -p 5000 bin/app.psgi (possibly more arguments). plackup is just a perl script, so you can try perl -d `which plackup` -p 5000 bin/app.psgi

0
source

Source: https://habr.com/ru/post/1268258/


All Articles