Commit | Line | Data |
---|---|---|
68d6f889 | 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); |