You can use some trickery and get the warning to kick the debugger into single-step mode:
use strict; use warnings; $SIG{__WARN__} = sub { $DB::single = 1 }; my $c = 3; my $d = 'foo'; my $e = $c + $d; print "$e\n";
This will stop the program after the warning that caused the error (the addition of $c and $d). It is a much more difficult proposition to stop the program before the warning. Then again, this is probably sufficient 99.99% percent of the time.
Note that you still have to run the program under the debugger: perl -d myprogram. The gain is that you just have to <r>un the program, and it will churn away until a warning is raised.
• another intruder with the mooring in the heart of the Perl
In reply to Re: break on warning in debugger
by grinder
in thread break on warning in debugger
by confused_newbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |