- my %podinfo = ( section => $section );
-
- print STDERR "DEBUG: Reading $podpath\n" if $options{debug};
- open my $pod_fh, $podpath or die "Trying to read $podpath: $!\n";
- while (<$pod_fh>) {
- s|\R$||;
- if (m|^=for\s+comment\s+openssl_manual_section:\s*([0-9])\s*$|) {
- print STDERR "Found section number $1\n" if $options{debug};
- $podinfo{section} = $1;
- }
- last if (m|^=head1|
- && defined $podinfo{lastsect}
- && $podinfo{lastsect} eq "NAME");
- if (m|^=head1\s*(.*)|) {
- $podinfo{lastsect} = $1;
- $podinfo{lastsect} =~ s/\s+$//;
- $podinfo{lastsecttext} = "";
- }
- next if (m|^=| || m|^\s*$|);
- $podinfo{lastsecttext} .= " " if $podinfo{lastsecttext};
- $podinfo{lastsecttext} .= $_;
- }
- close $pod_fh;
- $podinfo{lastsecttext} =~ s| - .*$||;
- print STDERR "DEBUG: Done reading $podpath\n" if $options{debug};
-
- my @podfiles =
- grep { $_ ne $podname }
- map { s|\s+||g; $_ }
- split(m|,|, $podinfo{lastsecttext});
+ my %podinfo = extract_pod_info($podpath,
+ { debug => $options{debug},
+ section => $section });
+ my @podfiles = grep { $_ ne $podname } @{$podinfo{names}};