I have following script:
#!/usr/bin/env perl
sub bar { foo() }
sub foo { }
sub hello { bar(); }
hello();
I run it with non-interactive debugger and got:
$ PERL5OPT=-d PERLDB_OPTS='N f=1' perl 2.pl
Package 2.pl.
entering DB::Obj::_init
entering main::hello
entering main::bar
entering main::foo
Now I want to stop printing stacktrace by disabling debugger after bar() call. How to do that ?
What I tried:
#!/usr/bin/env perl
sub bar {
# $^D; # no effect
# DB::done(); # Undefined subroutine &DB::done
# $DB::finished=1; # no effect
# delete $INC{'perl5db.pl'}; # no effect
# Class::Unload->unload('perl5db.pl'); # no effect
foo();
}
sub foo { }
sub hello { bar(); }
hello();
But entering main::foo still printed.
Expected output:
Package 2.pl.
entering DB::Obj::_init
entering main::hello
entering main::bar