projects
/
p5sagit/Mutually-Assured-Destruction.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
test now doesn't run but is closer to the right structure
[p5sagit/Mutually-Assured-Destruction.git]
/
notes
/
save-my-life-safely.pl
1
#!/usr/bin/env perl
2
3
use strict;
4
use warnings;
5
use Devel::GlobalDestruction ();
6
7
my %objs;
8
9
BEGIN {
10
package Foo;
11
12
sub DESTROY {
13
warn "DESTROY\n";
14
return if Devel::GlobalDestruction::in_global_destruction();
15
$objs{$_[0]} = $_[0];
16
}
17
}
18
19
{
20
bless({}, 'Foo');
21
}
22
23
warn join(', ', %objs);