Improve pod2man diagnostic when NAME is invalid
Chip Salzenberg [Fri, 21 Mar 1997 02:38:44 +0000 (14:38 +1200)]
pod/pod2man.PL

index 88ce73f..bd4dd41 100644 (file)
@@ -416,9 +416,16 @@ if ($name ne 'something') {
                unless (/\s*-+\s+/) {
                    $oops++;
                    warn "$0: Improper man page - no dash in NAME header in paragraph $. of $ARGV[0]\n"
-                  } else {
-                    %namedesc = split /\s+-+\s+/;
-                  }
+                } else {
+                   my @n = split /\s+-+\s+/;
+                   if (@n != 2) {
+                       $oops++;
+                       warn "$0: Improper man page - malformed NAME header in paragraph $. of $ARGV[0]\n"
+                   }
+                   else {
+                       %namedesc = @n;
+                   }
+               }
                last FCHECK;
            }
            next if /^=cut\b/;  # DB_File and Net::Ping have =cut before NAME