This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
As suggested by Anton Tagunov, eq and cmp now obey the
[perl5.git] / configpm
index 9f1a2e1..a22f9a2 100755 (executable)
--- a/configpm
+++ b/configpm
@@ -420,20 +420,25 @@ $text = 0;
 $/ = '';
 
 sub process {
-  s/\A(\w*)\s+\(([\w.]+)\):\s*\n(\t?)/=item C<$1>\n\nFrom F<$2>:\n\n/m;
-  my $c = substr $1, 0, 1;
-  unless ($seen{$c}++) {
-    print CONFIG <<EOF if $text;
+  if (s/\A(\w*)\s+\(([\w.]+)\):\s*\n(\t?)/=item C<$1>\n\nFrom F<$2>:\n\n/m) {
+    my $c = substr $1, 0, 1;
+    unless ($seen{$c}++) {
+      print CONFIG <<EOF if $text;
 =back
 
 EOF
-    print CONFIG <<EOF;
+      print CONFIG <<EOF;
 =head2 $c
 
 =over 4
 
 EOF
-    $text = 1;
+     $text = 1;
+    }
+  }
+  elsif (!$text || !/\A\t/) {
+    warn "Expected a Configure variable header",
+      ($text ? " or another paragraph of description" : () );
   }
   s/n't/n\00t/g;               # leave can't, won't etc untouched
   s/^\t\s+(.*)/\n\t$1\n/gm;    # Indented lines ===> paragraphs
@@ -446,8 +451,14 @@ EOF
      (?! e \. g \. )           # Not e.g.
      (?! \. \. \. )            # Not ...
      (?! \d )                  # Not 5.004
-     ( [\w./]* [./] [\w./]* )  # Require . or / inside
-     (?<! \. (?= \s ) )                # Do not include trailing dot
+     (?! read/ )               # Not read/write
+     (?! etc\. )               # Not etc.
+     (?! I/O )                 # Not I/O
+     (
+       \$ ?                    # Allow leading $
+       [\w./]* [./] [\w./]*    # Require . or / inside
+     )
+     (?<! \. (?= [\s)] ) )     # Do not include trailing dot
      (?! [\w/] )               # Include all of it
    }
    (F<$1>)xg;                  # /usr/local