line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
897
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
2
|
|
|
|
|
|
|
package YAML::Any; |
3
|
|
|
|
|
|
|
our $VERSION = '1.29'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
6
|
use Exporter (); |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
137
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
@YAML::Any::ISA = 'Exporter'; |
8
|
|
|
|
|
|
|
@YAML::Any::EXPORT = qw(Dump Load); |
9
|
|
|
|
|
|
|
@YAML::Any::EXPORT_OK = qw(DumpFile LoadFile); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my @dump_options = qw( |
12
|
|
|
|
|
|
|
UseCode |
13
|
|
|
|
|
|
|
DumpCode |
14
|
|
|
|
|
|
|
SpecVersion |
15
|
|
|
|
|
|
|
Indent |
16
|
|
|
|
|
|
|
UseHeader |
17
|
|
|
|
|
|
|
UseVersion |
18
|
|
|
|
|
|
|
SortKeys |
19
|
|
|
|
|
|
|
AnchorPrefix |
20
|
|
|
|
|
|
|
UseBlock |
21
|
|
|
|
|
|
|
UseFold |
22
|
|
|
|
|
|
|
CompressSeries |
23
|
|
|
|
|
|
|
InlineSeries |
24
|
|
|
|
|
|
|
UseAliases |
25
|
|
|
|
|
|
|
Purity |
26
|
|
|
|
|
|
|
Stringify |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my @load_options = qw( |
30
|
|
|
|
|
|
|
UseCode |
31
|
|
|
|
|
|
|
LoadCode |
32
|
|
|
|
|
|
|
Preserve |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my @implementations = qw( |
36
|
|
|
|
|
|
|
YAML::XS |
37
|
|
|
|
|
|
|
YAML::Syck |
38
|
|
|
|
|
|
|
YAML::Old |
39
|
|
|
|
|
|
|
YAML |
40
|
|
|
|
|
|
|
YAML::Tiny |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub import { |
44
|
1
|
|
|
1
|
|
9
|
__PACKAGE__->implementation; |
45
|
1
|
|
|
|
|
37
|
goto &Exporter::import; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub Dump { |
49
|
1
|
|
|
1
|
|
7
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
50
|
1
|
|
|
1
|
|
4
|
no warnings 'once'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
150
|
|
51
|
0
|
|
|
0
|
1
|
0
|
my $implementation = __PACKAGE__->implementation; |
52
|
0
|
|
|
|
|
0
|
for my $option (@dump_options) { |
53
|
0
|
|
|
|
|
0
|
my $var = "$implementation\::$option"; |
54
|
0
|
|
|
|
|
0
|
my $value = $$var; |
55
|
0
|
|
|
|
|
0
|
local $$var; |
56
|
0
|
0
|
|
|
|
0
|
$$var = defined $value ? $value : ${"YAML::$option"}; |
|
0
|
|
|
|
|
0
|
|
57
|
|
|
|
|
|
|
} |
58
|
0
|
|
|
|
|
0
|
return &{"$implementation\::Dump"}(@_); |
|
0
|
|
|
|
|
0
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub DumpFile { |
62
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
37
|
|
63
|
1
|
|
|
1
|
|
5
|
no warnings 'once'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
168
|
|
64
|
0
|
|
|
0
|
1
|
0
|
my $implementation = __PACKAGE__->implementation; |
65
|
0
|
|
|
|
|
0
|
for my $option (@dump_options) { |
66
|
0
|
|
|
|
|
0
|
my $var = "$implementation\::$option"; |
67
|
0
|
|
|
|
|
0
|
my $value = $$var; |
68
|
0
|
|
|
|
|
0
|
local $$var; |
69
|
0
|
0
|
|
|
|
0
|
$$var = defined $value ? $value : ${"YAML::$option"}; |
|
0
|
|
|
|
|
0
|
|
70
|
|
|
|
|
|
|
} |
71
|
0
|
|
|
|
|
0
|
return &{"$implementation\::DumpFile"}(@_); |
|
0
|
|
|
|
|
0
|
|
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub Load { |
75
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
76
|
1
|
|
|
1
|
|
4
|
no warnings 'once'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
152
|
|
77
|
0
|
|
|
0
|
1
|
0
|
my $implementation = __PACKAGE__->implementation; |
78
|
0
|
|
|
|
|
0
|
for my $option (@load_options) { |
79
|
0
|
|
|
|
|
0
|
my $var = "$implementation\::$option"; |
80
|
0
|
|
|
|
|
0
|
my $value = $$var; |
81
|
0
|
|
|
|
|
0
|
local $$var; |
82
|
0
|
0
|
|
|
|
0
|
$$var = defined $value ? $value : ${"YAML::$option"}; |
|
0
|
|
|
|
|
0
|
|
83
|
|
|
|
|
|
|
} |
84
|
0
|
|
|
|
|
0
|
return &{"$implementation\::Load"}(@_); |
|
0
|
|
|
|
|
0
|
|
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub LoadFile { |
88
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
89
|
1
|
|
|
1
|
|
7
|
no warnings 'once'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
337
|
|
90
|
0
|
|
|
0
|
1
|
0
|
my $implementation = __PACKAGE__->implementation; |
91
|
0
|
|
|
|
|
0
|
for my $option (@load_options) { |
92
|
0
|
|
|
|
|
0
|
my $var = "$implementation\::$option"; |
93
|
0
|
|
|
|
|
0
|
my $value = $$var; |
94
|
0
|
|
|
|
|
0
|
local $$var; |
95
|
0
|
0
|
|
|
|
0
|
$$var = defined $value ? $value : ${"YAML::$option"}; |
|
0
|
|
|
|
|
0
|
|
96
|
|
|
|
|
|
|
} |
97
|
0
|
|
|
|
|
0
|
return &{"$implementation\::LoadFile"}(@_); |
|
0
|
|
|
|
|
0
|
|
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub order { |
101
|
|
|
|
|
|
|
return @YAML::Any::_TEST_ORDER |
102
|
1
|
50
|
|
1
|
1
|
4
|
if @YAML::Any::_TEST_ORDER; |
103
|
1
|
|
|
|
|
2
|
return @implementations; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub implementation { |
107
|
1
|
|
|
1
|
1
|
3
|
my @order = __PACKAGE__->order; |
108
|
1
|
|
|
|
|
3
|
for my $module (@order) { |
109
|
4
|
|
|
|
|
10
|
my $path = $module; |
110
|
4
|
|
|
|
|
14
|
$path =~ s/::/\//g; |
111
|
4
|
|
|
|
|
9
|
$path .= '.pm'; |
112
|
4
|
100
|
|
|
|
13
|
return $module if exists $INC{$path}; |
113
|
3
|
50
|
|
|
|
182
|
eval "require $module; 1" and return $module; |
114
|
|
|
|
|
|
|
} |
115
|
0
|
|
|
|
|
|
croak("YAML::Any couldn't find any of these YAML implementations: @order"); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
sub croak { |
119
|
0
|
|
|
0
|
0
|
|
require Carp; |
120
|
0
|
|
|
|
|
|
Carp::croak(@_); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
1; |