On 27 Feb 2008, at 13:47, Andy Armstrong wrote:
Hmm. I hoped that talking to the bear would make the solution
apparent - but it seems I actually have to hit send this time :)
This kind of thing works well (and is already proving useful) for
breaking on exit from a scope:
#!/usr/bin/perl
use strict;
use warnings;
$| = 1;
package Breaker;
sub new { bless {}, shift }
sub DESTROY {
$DB::single = $DB::single = 1;
}
package main;
sub break_on_exit {
my $boe = Breaker->new;
print "Here we go...\n";
return 1;
}
break_on_exit;
print "With any luck we should stop here...\n";
The debugger stops at the last print. It doesn't directly help in the
case where the scope that decides whether to break is further below
the scope you want to stop in though.
--
Andy Armstrong, Hexten