line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Package::Butcher::Inflator; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Borrows heavily from Hash::Inflator |
4
|
2
|
|
|
2
|
|
16
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
59
|
|
5
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1199
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
4
|
|
|
4
|
0
|
6
|
my $class = shift; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#return $_[0] if @_ == 1 && !ref $_[0]; |
13
|
4
|
|
|
|
|
6
|
my %hash = %{ $_[0] }; |
|
4
|
|
|
|
|
11
|
|
14
|
4
|
|
|
|
|
10
|
for my $key ( keys %hash ) { |
15
|
4
|
100
|
|
|
|
15
|
if ( ref $hash{$key} eq 'HASH' ) { |
16
|
3
|
|
|
|
|
13
|
$hash{$key} = $class->new( $hash{$key} ); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
} |
19
|
4
|
|
|
|
|
22
|
bless \%hash, $class; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub AUTOLOAD { |
23
|
4
|
|
|
4
|
|
6
|
my $self = shift; |
24
|
4
|
|
|
|
|
5
|
our $AUTOLOAD; |
25
|
4
|
|
|
|
|
15
|
$AUTOLOAD =~ s/.+:://; |
26
|
4
|
|
|
|
|
10
|
my $result = $self->{$AUTOLOAD}; |
27
|
4
|
100
|
|
|
|
11
|
if ( 'CODE' eq ref $result ) { |
28
|
1
|
|
|
|
|
6
|
goto $result; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
else { |
31
|
3
|
|
|
|
|
22
|
return $result; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |