This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
podcheck.t: Move a declaration
authorKarl Williamson <khw@cpan.org>
Wed, 25 May 2016 16:40:51 +0000 (10:40 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 27 May 2016 00:30:08 +0000 (18:30 -0600)
This just moves a variable declaration and initialization to elsewhere
in the file where it can be used in a different place in a future
commit.  And it is now placed where it is more visible, as it really is
a program-level definition.

The code is outdented as well, and the comment unwrapped to be on a
single line, but no other changes were made.

t/porting/podcheck.t

index 8b049e4..cefe58f 100644 (file)
@@ -439,6 +439,22 @@ my $non_pods = qr/ (?: \.
                            | ^(?i:Makefile\.PL)$
                 /x;
 
+# Matches something that looks like a file name, but is enclosed in C<...>
+my $C_path_re = qr{ \b ( C<
+                        # exclude various things that have slashes
+                        # in them but aren't paths
+                        (?!
+                            (?: (?: s | qr | m) / ) # regexes
+                            | \d+/\d+>       # probable fractions
+                            | OS/2>
+                            | Perl/Tk>
+                            | origin/blead>
+                            | origin/maint
+                            | -    # File names don't begin with "-"
+                            )
+                            [-\w]+ (?: / [-\w]+ )+ (?: \. \w+ )? > )
+                    }x;
+
 # '.PL' files should be excluded, as they aren't final pods, but often contain
 # material used in generating pods, and so can look like a pod.  We can't use
 # the regexp above because case sensisitivity is important for these, as some
@@ -857,23 +873,6 @@ package My::Pod::Checker {      # Extend Pod::Checker
         }
         $paragraph = join " ", split /^/, $paragraph;
 
-        # Matches something that looks like a file name, but is enclosed in
-        # C<...>
-        my $C_path_re = qr{ \b ( C<
-                                # exclude various things that have slashes
-                                # in them but aren't paths
-                                (?!
-                                    (?: (?: s | qr | m) / ) # regexes
-                                    | \d+/\d+>       # probable fractions
-                                    | OS/2>
-                                    | Perl/Tk>
-                                    | origin/blead>
-                                    | origin/maint
-                                    | -    # File names don't begin with "-"
-                                 )
-                                 [-\w]+ (?: / [-\w]+ )+ (?: \. \w+ )? > )
-                          }x;
-
         # If looks like a reference to other documentation by containing the
         # word 'See' and then a likely pod directive, warn.
         while ($paragraph =~ m{