Created
December 9, 2012 12:40
-
-
Save wakaba/4244683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
package test::fuga; | |
sub DESTROY { | |
warn "fuga->DESTROY called"; | |
} | |
} | |
my $fuga = bless {}, 'test::fuga'; | |
my @hoge; | |
Internals::SvREADONLY (@hoge, 1); | |
eval { | |
push @hoge, $fuga; | |
}; | |
warn 0+@hoge; | |
undef $fuga; | |
warn "End of program"; |
By removing the line Internals::SvREADONLY (@hoge, 1);
, it got:
$ perl b.pl
1 at b.pl line 15.
End of program at b.pl line 18.
fuga->DESTROY called at b.pl line 4.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Perl 5.10.1 / 5.16.2)