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