Debugging Catalyst

Ovid on 2009-08-14T13:02:14

Dear Lazyweb, I can't figure this out. I'd like to do something like this:

perl -MPIPs -de '$s = PIPs->new->model("PIPs")->schema; $DB::single = 1'

That would theoretically enter the debugger and I could just hit 'c' and continue to that breakpoint, have my variable set and start debugging my app. Instead, I have the following nasty alias:

alias debug_pips='echo "\$s = PIPs->new->model('PIPs')->schema";perl -MPIPs -de1'

And I just cut-n-paste the echoed line into the debugger. Is there a better way?


@DB::typeahead

mattk on 2009-08-14T15:28:34

This should do it:

perl -de 'BEGIN { push @DB::typeahead, q{$s = PIPs->new->model("PIPs")->schema} }; 1'

How about....

tgape on 2009-08-15T02:17:05

perl -MPIPs -de '$s = PIPs->new->model("PIPs")->schema; $DB::single = 1;print'

Setting $DB::single makes perl stop before the *next* command.  If there is no next command, it won't stop.

Enbugger? Devel::REPL?

nothingmuch on 2009-08-15T03:44:18

Though the other comments seem to address your issue, have you seen Enbugger?

Secondly, mentioning Devel::REPL also seems appropriate, though it isn't the same thing at all.