| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
2
|
|
|
2
|
|
423980
|
use v5.40; |
|
|
2
|
|
|
|
|
8
|
|
|
2
|
2
|
|
|
2
|
|
14
|
use feature 'class'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
496
|
|
|
3
|
2
|
|
|
2
|
|
19
|
no warnings 'experimental::class'; |
|
|
2
|
|
|
|
|
16
|
|
|
|
2
|
|
|
|
|
243
|
|
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
package Archive::CAR v0.0.3 { |
|
6
|
2
|
|
|
2
|
|
1010
|
use Archive::CAR::v1; |
|
|
2
|
|
|
|
|
7
|
|
|
|
2
|
|
|
|
|
72
|
|
|
7
|
2
|
|
|
2
|
|
898
|
use Archive::CAR::v2; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
783
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
6
|
|
|
6
|
1
|
298681
|
sub from_file ( $class, $filename ) { |
|
|
6
|
|
|
|
|
12
|
|
|
|
6
|
|
|
|
|
9
|
|
|
|
6
|
|
|
|
|
7
|
|
|
10
|
6
|
50
|
|
|
|
281
|
open( my $fh, '<:raw', $filename ) or die "Can't open $filename: $!"; |
|
11
|
6
|
|
|
|
|
11
|
my $first_bytes; |
|
12
|
6
|
|
|
|
|
1121
|
read( $fh, $first_bytes, 11 ); |
|
13
|
6
|
|
|
|
|
48
|
seek( $fh, 0, 0 ); |
|
14
|
6
|
100
|
66
|
|
|
79
|
return Archive::CAR::v2->new()->read($fh) |
|
15
|
|
|
|
|
|
|
if $first_bytes eq pack( 'H*', '0aa16776657273696f6e02' ) || $first_bytes eq pack( 'H*', '0aa26576657273696f6e02' ); |
|
16
|
3
|
|
|
|
|
49
|
return Archive::CAR::v1->new()->read($fh); |
|
17
|
|
|
|
|
|
|
} |
|
18
|
|
|
|
|
|
|
|
|
19
|
4
|
|
|
4
|
1
|
41
|
sub write ( $class, $filename, $roots, $blocks, $version = 1 ) { |
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
5
|
|
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
4
|
|
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
3
|
|
|
20
|
4
|
50
|
|
|
|
276
|
open( my $fh, '>:raw', $filename ) or die "Can't open $filename for writing: $!"; |
|
21
|
4
|
100
|
|
|
|
101
|
my $car_obj = $version == 2 ? Archive::CAR::v2->new() : Archive::CAR::v1->new(); |
|
22
|
4
|
|
|
|
|
25
|
$car_obj->write( $fh, $roots, $blocks ); |
|
23
|
4
|
|
|
|
|
459
|
close($fh); |
|
24
|
|
|
|
|
|
|
} |
|
25
|
|
|
|
|
|
|
}; |
|
26
|
|
|
|
|
|
|
# |
|
27
|
|
|
|
|
|
|
1; |