line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Value::Canary; |
2
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# ABSTRACT: Callbacks for value destruction |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
72933
|
use Carp 'cluck'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
85
|
|
8
|
1
|
|
|
1
|
|
2182
|
use Variable::Magic qw/wizard cast/; |
|
1
|
|
|
|
|
4048
|
|
|
1
|
|
|
|
|
87
|
|
9
|
1
|
|
|
1
|
|
3847
|
use namespace::clean; |
|
1
|
|
|
|
|
76283
|
|
|
1
|
|
|
|
|
7
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
16
|
use Sub::Exporter -setup => { |
12
|
|
|
|
|
|
|
exports => ['canary'], |
13
|
|
|
|
|
|
|
groups => { default => ['canary'] }, |
14
|
1
|
|
|
1
|
|
5128
|
}; |
|
1
|
|
|
|
|
37637
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $wiz = wizard data => sub { $_[1] }, |
18
|
|
|
|
|
|
|
free => sub { $_[1]->($_[0]) }; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub canary { |
22
|
1
|
|
|
1
|
1
|
15
|
my $cb = $_[1]; |
23
|
1
|
|
50
|
0
|
|
4
|
$cb ||= sub { cluck "${ $_[0] } destroyed" }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
24
|
1
|
|
|
|
|
9
|
cast $_[0], $wiz, $cb; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |