projects
/
p5sagit/Mutually-Assured-Destruction.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
c164daf64b01ffd2a84f2532811866df639d4921
[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);