line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Hash::Util::FieldHash::Compat; # git description: v0.09-4-gf463ebf |
2
|
|
|
|
|
|
|
# ABSTRACT: Use Hash::Util::FieldHash or ties, depending on availability |
3
|
|
|
|
|
|
|
# KEYWORDS: fields hashes fieldhash backwards compatibility backcompat tie |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
23448
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
6
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
79
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.10'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use constant REAL_FIELDHASH => do { local $@; local $SIG{__DIE__}; eval { require Hash::Util::FieldHash } }; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
957
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
BEGIN { |
13
|
1
|
|
|
1
|
|
438630
|
if ( REAL_FIELDHASH ) { |
14
|
1
|
|
|
|
|
21
|
require Hash::Util::FieldHash; |
15
|
1
|
|
|
|
|
478
|
Hash::Util::FieldHash->import(":all"); |
16
|
|
|
|
|
|
|
} else { |
17
|
|
|
|
|
|
|
require Hash::Util::FieldHash::Compat::Heavy; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub import { |
22
|
1
|
|
|
1
|
|
13
|
if ( REAL_FIELDHASH ) { |
23
|
1
|
|
|
|
|
4
|
my $class = "Hash::Util::FieldHash"; |
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
|
|
3
|
shift @_; |
26
|
1
|
|
|
|
|
5
|
unshift @_, $class; |
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
4141
|
goto $class->can("import"); |
29
|
|
|
|
|
|
|
} else { |
30
|
|
|
|
|
|
|
my $class = shift; |
31
|
|
|
|
|
|
|
$class->export_to_level(1, $class, @_); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__PACKAGE__ |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |