This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
podcheck.t: Avoid misleading error message
authorKarl Williamson <public@khwilliamson.com>
Fri, 22 Mar 2013 18:25:00 +0000 (12:25 -0600)
committerKarl Williamson <public@khwilliamson.com>
Mon, 20 May 2013 14:59:12 +0000 (08:59 -0600)
If there are input files on the command line that don't exist, prior to
this commit, the message was output that they are transitory.  This adds
a check and a correct message.

t/porting/podcheck.t

index 9864af6..1d018f6 100644 (file)
@@ -567,10 +567,13 @@ if (($regen + $show_all + $show_counts + $add_link + $cpan_or_deltas ) > 1) {
 
 my $has_input_files = @files;
 
-if ($has_input_files
-    && ($regen || $show_counts || $do_upstream_cpan || $do_deltas))
-{
-    croak "--regen, --counts, --deltas, and --cpan can't be used since using specific files";
+if ($has_input_files) {
+    if ($regen || $show_counts || $do_upstream_cpan || $do_deltas) {
+        croak "--regen, --counts, --deltas, and --cpan can't be used since using specific files";
+    }
+    foreach my $file (@files) {
+        croak "Can't read file '$file'" if ! -r $file;
+    }
 }
 
 if ($add_link && ! $has_input_files) {