| 1 | package Pod::Tree::Stream; | ||||||||||
| 2 | 34 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 34 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 34 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 34 | our $VERSION = '1.31'; | |||||||||
| 7 | |||||||||||
| 8 | 187 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 9 | 187 | my ( $package, $fh ) = @_; | |||||||||
| 10 | |||||||||||
| 11 | 187 | my $stream = { | |||||||||
| 12 | fh => $fh, | ||||||||||
| 13 | line => '' | ||||||||||
| 14 | }; | ||||||||||
| 15 | |||||||||||
| 16 | 187 | bless $stream, $package; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 3222 | ▶ | sub get_paragraph { | ||||||||
|
Subroutine
get_paragraph: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||
| 20 | 3222 | my $stream = shift; | |||||||||
| 21 | 3222 | my $fh = $stream->{fh}; | |||||||||
| 22 | 3222 | my $line = $stream->{line}; | |||||||||
| 23 | |||||||||||
| 24 | 3222 | ▶ | defined $line or return undef; ##no critic (ProhibitExplicitReturnUndef) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | |||||||||||
| 26 | 3036 | my (@lines) = ($line); | |||||||||
| 27 | 3036 | ▶ | while ( $line = $fh->getline ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 3753 | push @lines, $line; | |||||||||
| 29 | 3753 | ▶ | $line =~ /\S/ or last; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | 3036 | ▶ | while ( $line = $fh->getline ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 3140 | ▶ | $line =~ /\S/ and last; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | 291 | push @lines, $line; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 3036 | $stream->{line} = $line; | |||||||||
| 38 | 3036 | join '', @lines; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 34 | 1; | |||||||||
| 42 | |||||||||||