diff options
author | Nicholas Clark <nick@ccl4.org> | 2012-04-17 15:59:44 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-05-23 14:32:40 +0200 |
commit | 741c0772bf49e348fe0e2ea00a8937512b03d074 (patch) | |
tree | c3a9ff95017b05c9d9ab2f0506b0fe2d149e9283 /autodoc.pl | |
parent | e8e591c9e54c36d7ebf5510f581c0061e7853f90 (diff) | |
download | perl-741c0772bf49e348fe0e2ea00a8937512b03d074.tar.gz |
Refactor autodoc.pl to read MANIFEST line by line, instead of slurping it.
Diffstat (limited to 'autodoc.pl')
-rw-r--r-- | autodoc.pl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/autodoc.pl b/autodoc.pl index d243592ef1..f82593e27b 100644 --- a/autodoc.pl +++ b/autodoc.pl @@ -325,21 +325,19 @@ foreach (@{(setup_embed())[0]}) { }; } -my $file; # glob() picks up docs from extra .c or .h files that may be in unclean # development trees. -my $MANIFEST = do { - local ($/, *FH); - open FH, "MANIFEST" or die "Can't open MANIFEST: $!"; - <FH>; -}; +open my $fh, '<', 'MANIFEST' + or die "Can't open MANIFEST: $!"; +while (my $line = <$fh>) { + next unless my ($file) = $line =~ /^(\S+\.[ch])\t/; -for $file (($MANIFEST =~ /^(\S+\.c)\t/gm), ($MANIFEST =~ /^(\S+\.h)\t/gm)) { open F, "< $file" or die "Cannot open $file for docs: $!\n"; $curheader = "Functions in file $file\n"; autodoc(\*F,$file); close F or die "Error closing $file: $!\n"; } +close $fh or die "Error whilst reading MANIFEST: $!"; for (sort keys %funcflags) { next unless $funcflags{$_}{flags} =~ /d/; |