From d72ea276d97aed1297904ca4cf2775b6f2a7db15 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Mon, 19 Dec 2011 16:25:44 +0100 Subject: [PATCH] Restructure the heredocs in perlmodlib.PL so the file as-is is valid Pod. Using =cut as the heredoc terminator makes the whole file parse as (reasonably) sane Pod as-is to anything that attempts to brute-force treat it as such. The content is already useful - this just makes it tidier, by stopping anything doing this mistaking the rest of the Perl code for Pod. --- pod/perlmodlib.PL | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/pod/perlmodlib.PL b/pod/perlmodlib.PL index 74e85e7..36990f9 100644 --- a/pod/perlmodlib.PL +++ b/pod/perlmodlib.PL @@ -80,14 +80,16 @@ for my $filename (@files) { # Much easier to special case it like this than special case the depending on # and parsing lib/Config.pod, or special case opening configpm and finding its # =head1 (which is not found with the $/="" above) -push @mod, <<'CONFIG'; -=item Config +push @mod, "=item Config\n\nAccess Perl configuration information\n\n"; -Access Perl configuration information -CONFIG +# The intent of using =cut as the heredoc terminator is to make the whole file +# parse as (reasonably) sane Pod as-is to anything that attempts to +# brute-force treat it as such. The content is already useful - this just +# makes it tidier, by stopping anything doing this mistaking the rest of the +# Perl code for Pod. eg http://search.cpan.org/dist/perl/pod/perlmodlib.PL -print OUT <<'EOF'; +print OUT <<'=cut'; =for maintainers Generated by perlmodlib.PL -- DO NOT EDIT! @@ -137,11 +139,12 @@ The following pragmas are defined (and have their own documentation). =over 12 -EOF +=cut print OUT $_ for (sort @pragma); -print OUT < modules installed on your system, including @@ -1503,7 +1507,8 @@ that a module doesn't pollute any namespace it wasn't asked to. The written contract for the module (A.K.A. documentation) may make other provisions. But then you know when you C that you're redefining the world and willing to take the consequences. -EOF + +=cut close MANIFEST or warn "$0: failed to close MANIFEST (../MANIFEST): $!"; close OUT or warn "$0: failed to close OUT (perlmodlib.pod): $!"; -- 2.7.4