From: David Mitchell Date: Wed, 18 May 2011 15:43:50 +0000 (+0100) Subject: buildtoc - fix a bug and add some comments X-Git-Tag: accepted/trunk/20130322.191538~4316 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0f3b1adda7d8e9b56ccba6356ea739d266c5afd;p=platform%2Fupstream%2Fperl.git buildtoc - fix a bug and add some comments while(readdir) doesn't auto-assign to $_ Also, make the informative output clear that its telling you like of files it will be processing, rather than that its actually processing it now. --- diff --git a/pod/buildtoc b/pod/buildtoc index 3b61619..bfc39da 100644 --- a/pod/buildtoc +++ b/pod/buildtoc @@ -54,6 +54,8 @@ foreach (values %Targets) { $_ = abs_from_top($_); } +# process command-line switches + { my @files = keys %Targets; my $filesopts = join(" | ", map { "--build-$_" } "all", sort @files); @@ -101,9 +103,12 @@ __USAGE__ ); if ($Verbose) { - print "I'm building $_\n" foreach keys %Build; + print "I will be building $_\n" foreach keys %Build; } + +# process pod.lst + open my $master, '<', $masterpodfile or die "$0: Can't open $masterpodfile: $!"; my ($delta_source, $delta_target); @@ -188,7 +193,7 @@ close $master; } opendir my $dh, abs_from_top('pod/'); - while (readdir $dh) { + while (defined ($_ = readdir $dh)) { next unless /\.pod\z/; push @disk_pods, $_; ++$disk_pods{$_};