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 | 6744 | use 5.8.1; | |||
1 | 3 | ||||||
4 | 1 | 1 | 5 | use strict; | |||
1 | 2 | ||||||
1 | 22 | ||||||
5 | 1 | 1 | 5 | use warnings; | |||
1 | 2 | ||||||
1 | 161 | ||||||
6 | |||||||
7 | our $VERSION = '0.30'; | ||||||
8 | |||||||
9 | sub parser { | ||||||
10 | 2 | 2 | 0 | 8 | my ($file, $encoding, $opts) = @_; | ||
11 | 2 | 4 | my $html = do { | ||||
12 | 2 | 50 | 91 | open my $fh, '<:raw', $file or die "Cannot open $file: $!\n"; | |||
13 | 2 | 15 | local $/; | ||||
14 | 2 | 76 | <$fh>; | ||||
15 | }; | ||||||
16 | 2 | 100 | 22 | return $html =~ /\S/ ? $html : undef | |||
17 | } | ||||||
18 | |||||||
19 | 1; | ||||||
20 | __END__ |