return if $file =~ m!XS/(?:APItest|Typemap)!;
my $pod = $_;
return if $pod =~ s/pm$/pod/ && -e $pod;
- open my $f, '<', $_ or my_die "Can't open file '$_': $!";
- {
- my $line;
- while ($line = <$f>) {
- if ($line =~ /^=head1\s+NAME\b/) {
- push @modpods, $file;
- return;
- }
- }
- warn "$0: NOTE: cannot find '=head1 NAME' in:\n $file\n" unless $Quiet;
- }
+ push @modpods, $file;
}
}, 'lib');
sub podset {
my ($pod, $file) = @_;
- local $/ = '';
+ open my $fh, '<', $file or my_die "Can't open file '$file' for $pod: $!";
+
local *_;
+ my $found_pod;
+ while (<$fh>) {
+ if (/^=head1\s+NAME\b/) {
+ ++$found_pod;
+ last;
+ }
+ }
- open my $fh, '<', $file or my_die "Can't open file '$file' for $pod: $!";
+ unless ($found_pod) {
+ warn "$0: NOTE: cannot find '=head1 NAME' in:\n $file\n" unless $Quiet;
+ return;
+ }
+
+ seek $fh, 0, 0 or my_die "Can't rewind file '$file': $!";
+ local $/ = '';
while(<$fh>) {
tr/\015//d;