Subject: | Printing does not work at cleanup subroutine |
Hi. My testcase is:
$cat /Devel/DB.pm
package DB;
use Scope::Cleanup qw/ establish_cleanup /;
sub DB {
print "In DB\n";
establish_cleanup sub{ print "This is not printed\n" };
};
sub sub {
print "DB::DB is called for ", (caller)[0..3], "\n";
}
1;
$cat t.pl
1;
2;
$ perl -I. -d:DB t.pl
In DB
DB::DB is called for maint.pl1
In DB
DB::DB is called for maint.pl2
At this output I do not see this line: This is not printed
When I establish_cleanup from script ran not under debugger the printing works fine.