summaryrefslogtreecommitdiff
path: root/pod/perlmodlib.PL
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-06-13 21:43:30 +0100
committerNicholas Clark <nick@ccl4.org>2009-06-13 21:46:12 +0100
commit5b5041827ebfe6db62c72e5b64d221d66772b47a (patch)
tree5d308d39fafe069ae6e2f3516932a1f35fb3e7e6 /pod/perlmodlib.PL
parentcf9cbb1fcbe6c43ec204ccc0203775f22364127c (diff)
downloadperl-5b5041827ebfe6db62c72e5b64d221d66772b47a.tar.gz
Bring the joy of strict (and warnings) to perlmodlib.PL. Tweak some indenting.
Diffstat (limited to 'pod/perlmodlib.PL')
-rw-r--r--pod/perlmodlib.PL77
1 files changed, 39 insertions, 38 deletions
diff --git a/pod/perlmodlib.PL b/pod/perlmodlib.PL
index 99fca65f29..a013d26bab 100644
--- a/pod/perlmodlib.PL
+++ b/pod/perlmodlib.PL
@@ -1,5 +1,8 @@
#!../miniperl
+use strict;
+use warnings;
+
$ENV{LC_ALL} = 'C';
use FindBin;
@@ -34,46 +37,44 @@ for my $filename (@files) {
next;
}
+ my ($name, $thing);
+ my $foundit = 0;
+ {
+ local $/ = "";
+ while (<MOD>) {
+ next unless /^=head1 NAME/;
+ $foundit++;
+ last;
+ }
+ }
+ unless ($foundit) {
+ warn "$filename missing =head1 NAME (OK if respective .pod exists)\n"
+ unless $Quiet;
+ next;
+ }
+ my $title = <MOD>;
+ chomp $title;
+ close MOD;
- my ($name, $thing);
- my $foundit=0;
- {
- local $/="";
- while (<MOD>) {
- next unless /^=head1 NAME/;
- $foundit++;
- last;
- }
- }
- unless ($foundit) {
- warn "$filename missing =head1 NAME (OK if respective .pod exists)\n"
- unless $Quiet;
- next;
- }
- my $title = <MOD>;
- chomp($title);
- close MOD;
-
- ($name, $thing) = split / --? /, $title, 2;
-
- unless ($name and $thing) {
- warn "$filename missing name\n" unless $name;
- warn "$filename missing thing\n" unless $thing or $Quiet;
- next;
- }
-
- $name =~ s/[^A-Za-z0-9_:\$<>].*//;
- $name = $exceptions{$name} || $name;
- $thing =~ s/^perl pragma to //i;
- $thing = ucfirst($thing);
- $title = "=item $name\n\n$thing\n\n";
-
- if ($name =~ /[A-Z]/) {
- push @mod, $title;
- } else {
- push @pragma, $title;
- }
+ ($name, $thing) = split / --? /, $title, 2;
+ unless ($name and $thing) {
+ warn "$filename missing name\n" unless $name;
+ warn "$filename missing thing\n" unless $thing or $Quiet;
+ next;
+ }
+
+ $name =~ s/[^A-Za-z0-9_:\$<>].*//;
+ $name = $exceptions{$name} || $name;
+ $thing =~ s/^perl pragma to //i;
+ $thing = ucfirst $thing;
+ $title = "=item $name\n\n$thing\n\n";
+
+ if ($name =~ /[A-Z]/) {
+ push @mod, $title;
+ } else {
+ push @pragma, $title;
+ }
}
# Much easier to special case it like this than special case the depending on