4 use File::Basename qw(&basename &dirname);
7 # List explicitly here the variables you want Configure to
8 # generate. Metaconfig only looks for shell variables, so you
9 # have to mention them as if they were shell variables, not
10 # %Config entries. Thus you write
12 # to ensure Configure will look for $Config{startperl}.
14 # This forces PL files to create target in same directory as PL file.
15 # This is so that make depend always knows where to find PL derivatives.
18 ($file = basename($0)) =~ s/\.PL$//;
20 if ($^O eq 'VMS' or $^O eq 'os2' or $^O eq 'dos'); # "case-forgiving"
22 open OUT,">$file" or die "Can't create $file: $!";
24 print "Extracting $file (with variable substitutions)\n";
26 # In this section, perl variables will be expanded during extraction.
27 # You can use $Config{...} to use Configure variables.
29 print OUT <<"!GROK!THIS!";
31 eval 'exec perl -S \$0 "\$@"'
35 # In the following, perl variables are not expanded during extraction.
37 print OUT <<'!NO!SUBS!';
38 #############################################################################
39 # podchecker -- command to invoke the podchecker function in Pod::Checker
41 # Derived from Tom Christiansen's pod2text script.
42 # (with extensive modifications)
44 # Copyright (c) 1998 Bradford Appleton. All rights reserved.
45 # This file is part of "PodParser". PodParser is free software;
46 # you can redistribute it and/or modify it under the same terms
48 #############################################################################
55 podchecker - check the syntax of POD format documentation files
59 B<podchecker> [B<-help>] [B<-man>] [I<file>S< >...]
61 =head1 OPTIONS AND ARGUMENTS
67 Print a brief help message and exit.
71 Print the manual page and exit.
75 The pathname of a POD file to syntax-check (defaults to standard input).
81 B<podchecker> will read the given input files looking for POD
82 syntax errors in the POD documentation and will print any errors
83 it find to STDERR. At the end, it will print a status message
84 indicating the number of errors found.
86 B<podchecker> invokes the B<podchecker()> function exported by B<Pod::Checker>
87 Please see L<Pod::Checker/podchecker()> for more details.
91 L<Pod::Parser> and L<Pod::Checker>
95 Brad Appleton E<lt>bradapp@enteract.comE<gt>
97 Based on code for B<Pod::Text::pod2text(1)> written by
98 Tom Christiansen E<lt>tchrist@mox.perl.comE<gt>
114 GetOptions(\%options, "help", "man") || pod2usage(2);
115 pod2usage(1) if ($options{help});
116 pod2usage(-verbose => 2) if ($options{man});
118 ## Dont default to STDIN if connected to a terminal
119 pod2usage(2) if ((@ARGV == 0) && (-t STDIN));
121 ## Invoke podchecker()
123 for (@ARGV) { podchecker($_) };
125 podchecker("<&STDIN");
130 close OUT or die "Can't close $file: $!";
131 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
132 exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';