line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
604
|
use 5.008; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
36
|
|
2
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
310
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Hash::Inflator; |
6
|
|
|
|
|
|
|
our $VERSION = '1.100820'; |
7
|
|
|
|
|
|
|
# ABSTRACT: Access hash entries through methods |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
16
|
|
|
16
|
1
|
38
|
my $class = shift; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# handle simple scalars - could happen if we're called with the elements |
13
|
|
|
|
|
|
|
# of a list |
14
|
16
|
100
|
100
|
|
|
65
|
return $_[0] if @_ == 1 && !ref $_[0]; |
15
|
4
|
100
|
|
|
|
9
|
my %hash = @_ > 1 ? @_ : %{ $_[0] }; |
|
3
|
|
|
|
|
9
|
|
16
|
4
|
|
|
|
|
9
|
for my $key (keys %hash) { |
17
|
9
|
50
|
|
|
|
27
|
if (ref $hash{$key} eq 'HASH') { |
|
|
100
|
|
|
|
|
|
18
|
0
|
|
|
|
|
0
|
$hash{$key} = Hash::Inflator->new($hash{$key}); |
19
|
|
|
|
|
|
|
} elsif (ref $hash{$key} eq 'ARRAY') { |
20
|
3
|
|
|
|
|
2
|
$_ = Hash::Inflator->new($_) for @{ $hash{$key} }; |
|
3
|
|
|
|
|
11
|
|
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
4
|
|
|
|
|
15
|
bless \%hash, $class; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub AUTOLOAD { |
27
|
7
|
|
|
7
|
|
9169
|
my $self = shift; |
28
|
7
|
|
|
|
|
8
|
our $AUTOLOAD; |
29
|
7
|
|
|
|
|
36
|
$AUTOLOAD =~ s/.+:://; |
30
|
7
|
50
|
|
|
|
23
|
return if $AUTOLOAD =~ /^[A-Z]+$/; |
31
|
7
|
|
|
|
|
46
|
$self->{$AUTOLOAD}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |