| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
2
|
|
|
2
|
|
441746
|
use v5.40; |
|
|
2
|
|
|
|
|
9
|
|
|
2
|
2
|
|
|
2
|
|
13
|
use feature 'class'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
448
|
|
|
3
|
2
|
|
|
2
|
|
17
|
no warnings 'experimental::class'; |
|
|
2
|
|
|
|
|
14
|
|
|
|
2
|
|
|
|
|
250
|
|
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
package Archive::CAR v0.0.4 { |
|
6
|
2
|
|
|
2
|
|
1070
|
use Archive::CAR::v1; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
91
|
|
|
7
|
2
|
|
|
2
|
|
1064
|
use Archive::CAR::v2; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
805
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
1
|
352638
|
sub from_file ( $class, $filename ) { |
|
|
6
|
|
|
|
|
14
|
|
|
|
6
|
|
|
|
|
11
|
|
|
|
6
|
|
|
|
|
11
|
|
|
10
|
6
|
50
|
|
|
|
307
|
open( my $fh, '<:raw', $filename ) or die "Can't open $filename: $!"; |
|
11
|
6
|
|
|
|
|
12
|
my $first_bytes; |
|
12
|
6
|
|
|
|
|
186
|
read( $fh, $first_bytes, 11 ); |
|
13
|
6
|
|
|
|
|
50
|
seek( $fh, 0, 0 ); |
|
14
|
6
|
100
|
66
|
|
|
82
|
return Archive::CAR::v2->new()->read($fh) |
|
15
|
|
|
|
|
|
|
if $first_bytes eq pack( 'H*', '0aa16776657273696f6e02' ) || $first_bytes eq pack( 'H*', '0aa26576657273696f6e02' ); |
|
16
|
3
|
|
|
|
|
48
|
return Archive::CAR::v1->new()->read($fh); |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
4
|
|
|
4
|
1
|
37
|
sub write ( $class, $filename, $roots, $blocks, $version = 1 ) { |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
7
|
|
|
20
|
4
|
50
|
|
|
|
294
|
open( my $fh, '>:raw', $filename ) or die "Can't open $filename for writing: $!"; |
|
21
|
4
|
100
|
|
|
|
61
|
my $car_obj = $version == 2 ? Archive::CAR::v2->new() : Archive::CAR::v1->new(); |
|
22
|
4
|
|
|
|
|
68
|
$car_obj->write( $fh, $roots, $blocks ); |
|
23
|
4
|
|
|
|
|
718
|
close($fh); |
|
24
|
|
|
|
|
|
|
} |
|
25
|
|
|
|
|
|
|
}; |
|
26
|
|
|
|
|
|
|
# |
|
27
|
|
|
|
|
|
|
1; |