line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
1
|
|
|
1
|
|
889
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
4
|
1
|
|
|
1
|
|
4
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.0.2'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use JSON::PP; |
8
|
1
|
|
|
1
|
|
669
|
use YAML::PP; |
|
1
|
|
|
|
|
13829
|
|
|
1
|
|
|
|
|
53
|
|
9
|
1
|
|
|
1
|
|
488
|
use IO::All; |
|
1
|
|
|
|
|
56600
|
|
|
1
|
|
|
|
|
44
|
|
10
|
1
|
|
|
1
|
|
431
|
use Mo; |
|
1
|
|
|
|
|
9984
|
|
|
1
|
|
|
|
|
7
|
|
11
|
1
|
|
|
1
|
|
502
|
|
|
1
|
|
|
|
|
425
|
|
|
1
|
|
|
|
|
5
|
|
12
|
|
|
|
|
|
|
my $input = io('-')->utf8->all; |
13
|
|
|
|
|
|
|
my $output; |
14
|
0
|
|
|
0
|
0
|
|
my $json = JSON::PP->new->pretty->indent_length(2); |
15
|
0
|
|
|
|
|
|
my $yaml = YAML::PP->new; |
16
|
0
|
|
|
|
|
|
if ($input =~ /\A\s*[\{\[]/) { |
17
|
0
|
|
|
|
|
|
my $data = $json->decode($input); |
18
|
0
|
0
|
|
|
|
|
$output = $yaml->dump($data); |
19
|
0
|
|
|
|
|
|
} |
20
|
0
|
|
|
|
|
|
else { |
21
|
|
|
|
|
|
|
my $data = $yaml->load_string($input); |
22
|
|
|
|
|
|
|
$output = $json->encode($data); |
23
|
0
|
|
|
|
|
|
} |
24
|
0
|
|
|
|
|
|
$output .= "\n" unless $output =~ /\n\z/; |
25
|
|
|
|
|
|
|
binmode(STDOUT, ":utf8"); |
26
|
0
|
0
|
|
|
|
|
print $output; |
27
|
0
|
|
|
|
|
|
} |
28
|
0
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |