blib/lib/Text/Markup/HTML.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 14 | 14 | 100.0 |
branch | 3 | 4 | 75.0 |
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 21 | 23 | 91.3 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Text::Markup::HTML; | ||||||
2 | |||||||
3 | 1 | 1 | 3775 | use 5.8.1; | |||
1 | 4 | ||||||
4 | 1 | 1 | 6 | use strict; | |||
1 | 2 | ||||||
1 | 21 | ||||||
5 | 1 | 1 | 5 | use warnings; | |||
1 | 2 | ||||||
1 | 159 | ||||||
6 | |||||||
7 | our $VERSION = '0.25'; | ||||||
8 | |||||||
9 | sub parser { | ||||||
10 | 2 | 2 | 0 | 9 | my ($file, $encoding, $opts) = @_; | ||
11 | 2 | 3 | my $html = do { | ||||
12 | 2 | 50 | 86 | open my $fh, '<:raw', $file or die "Cannot open $file: $!\n"; | |||
13 | 2 | 11 | local $/; | ||||
14 | 2 | 95 | <$fh>; | ||||
15 | }; | ||||||
16 | 2 | 100 | 22 | return $html =~ /\S/ ? $html : undef | |||
17 | } | ||||||
18 | |||||||
19 | 1; | ||||||
20 | __END__ |