lib/Perlmazing/Perlmazing/slurp.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 11 | 11 | 100.0 |
branch | 2 | 4 | 50.0 |
condition | 1 | 3 | 33.3 |
subroutine | 2 | 2 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 16 | 21 | 76.1 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | 1 | 1 | 8 | use Perlmazing qw(croak); | |||
1 | 2 | ||||||
1 | 5 | ||||||
2 | |||||||
3 | sub main { | ||||||
4 | 2 | 2 | 0 | 5 | my $file = shift; | ||
5 | 2 | 3 | my $binary = shift; | ||||
6 | 2 | 8 | local $/ = undef; | ||||
7 | 2 | 50 | 75 | croak "File '$file' cannot be read: $!" unless open my $in, '<', $file; | |||
8 | 2 | 50 | 33 | 104 | binmode $in if -B $file or $binary; | ||
9 | 2 | 38 | my $data = <$in>; | ||||
10 | 2 | 19 | close $in; | ||||
11 | 2 | 24 | $data; | ||||
12 | } | ||||||
13 | |||||||
14 | 1; |