PodParser.pm (Module-Build-0.4232) | : | PodParser.pm (Module-Build-0.4234) | ||
---|---|---|---|---|
package Module::Build::PodParser; | package Module::Build::PodParser; | |||
use strict; | use strict; | |||
use warnings; | use warnings; | |||
our $VERSION = '0.4232'; | our $VERSION = '0.4234'; | |||
$VERSION = eval $VERSION; | $VERSION = eval $VERSION; | |||
sub new { | sub new { | |||
# Perl is so fun. | # Perl is so fun. | |||
my $package = shift; | my $package = shift; | |||
my $self; | my $self; | |||
$self = bless {have_pod_parser => 0, @_}, $package; | $self = bless {have_pod_parser => 0, @_}, $package; | |||
unless ($self->{fh}) { | unless ($self->{fh}) { | |||
skipping to change at line 28 | skipping to change at line 28 | |||
} | } | |||
return $self; | return $self; | |||
} | } | |||
sub parse_from_filehandle { | sub parse_from_filehandle { | |||
my ($self, $fh) = @_; | my ($self, $fh) = @_; | |||
local $_; | local $_; | |||
while (<$fh>) { | while (<$fh>) { | |||
next unless /^ =encoding \s+ (\S+)/ix; | ||||
binmode $fh, ":encoding($1)"; | ||||
last; | ||||
} | ||||
seek $fh, 0, 0; | ||||
while (<$fh>) { | ||||
next unless /^=(?!cut)/ .. /^=cut/; # in POD | next unless /^=(?!cut)/ .. /^=cut/; # in POD | |||
# Accept Name - abstract or C<Name> - abstract | # Accept Name - abstract or C<Name> - abstract | |||
last if ($self->{abstract}) = /^ (?: [a-z_0-9:]+ | [BCIF] < [a-z_0-9:]+ > ) \s+ - \s+ (.*\S) /ix; | last if ($self->{abstract}) = /^ (?: [a-z_0-9:]+ | [BCIF] < [a-z_0-9:]+ > ) \s+ - \s+ (.*\S) /ix; | |||
} | } | |||
my @author; | my @author; | |||
while (<$fh>) { | while (<$fh>) { | |||
next unless /^=head1\s+AUTHORS?/i ... /^=/; | next unless /^=head1\s+AUTHORS?/i ... /^=/; | |||
next if /^=/; | next if /^=/; | |||
push @author, $_ if /\@/; | push @author, $_ if /\@/; | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 8 lines changed or added |