use warnings;
require './test.pl';
-plan( tests => 66 );
+plan( tests => 68 );
# type coersion on assignment
$foo = 'foo';
is($x, "rocks\n");
}
+{
+ # Need some sort of die or warn to get the global destruction text if the
+ # bug is still present
+ my $output = runperl(prog => <<'EOPROG');
+package M;
+$| = 1;
+sub DESTROY {eval {die qq{Farewell $_[0]}}; print $@}
+package main;
+
+bless \$A::B, 'M';
+*A:: = \*B::;
+EOPROG
+ like($output, qr/^Farewell M=SCALAR/, "DESTROY was called");
+ unlike($output, qr/global destruction/,
+ "unreferenced symbol tables should be cleaned up immediately");
+}
__END__
Perl
Rules