in reply to Best way to debug in MVC
I sometimes use a debug switch in my code at critical points like:
This way you can turn off/on debugging by (un)setting the master-switch $DEBUG, and even use different $DEBUG values for different types of debugging, the sky is the limit.my $DEBUG=1; ... my $val = get_something("vars"); warn $val if ($DEBUG && ! $val); ... my $val2 = do_something_else($val); warn $val2 if ($DEBUG && $val2 =~ /^\w{2}\d{2}$/);
If you want to see the call tree of your program you could use Devel::Dprof.
If you want to see the content of complex structures, you could use Data::Dumper.
Some people really like the perl debugger, you can do some cool tricks with it, see the perldebug docs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Best way to debug in MVC
by perl_devel (Friar) on Jun 02, 2005 at 05:37 UTC |