4 use File::Basename qw(&basename &dirname);
6 # List explicitly here the variables you want Configure to
7 # generate. Metaconfig only looks for shell variables, so you
8 # have to mention them as if they were shell variables, not
9 # %Config entries. Thus you write
11 # to ensure Configure will look for $Config{startperl}.
15 $file .= '.com' if $^O eq 'VMS';
17 chdir("pod") or die "Can't chdir to pod: $!";
18 open OUT,">$file" or die "Can't create $file: $!";
20 print "Extracting $file (with variable substitutions)\n";
22 # In this section, perl variables will be expanded during extraction.
23 # You can use $Config{...} to use Configure variables.
25 print OUT <<"!GROK!THIS!";
27 eval 'exec perl -S \$0 "\$@"'
31 # In the following, perl variables are not expanded during extraction.
33 print OUT <<'!NO!SUBS!';
34 #############################################################################
35 # podchecker -- command to invoke the podchecker function in Pod::Checker
37 # Derived from Tom Christiansen's pod2text script.
38 # (with extensive modifications)
40 # Copyright (c) 1998 Bradford Appleton. All rights reserved.
41 # This file is part of "PodParser". PodParser is free software;
42 # you can redistribute it and/or modify it under the same terms
44 #############################################################################
51 podchecker - check the syntax of POD format documentation files
55 B<podchecker> [B<-help>] [B<-man>] [I<file>S< >...]
57 =head1 OPTIONS AND ARGUMENTS
63 Print a brief help message and exit.
67 Print the manual page and exit.
71 The pathname of a POD file to syntax-check (defaults to standard input).
77 B<podchecker> will read the given input files looking for POD
78 syntax errors in the POD documentation and will print any errors
79 it find to STDERR. At the end, it will print a status message
80 indicating the number of errors found.
82 B<podchecker> invokes the B<podchecker()> function exported by B<Pod::Checker>
83 Please see L<Pod::Checker/podchecker()> for more details.
87 L<Pod::Parser> and L<Pod::Checker>
91 Brad Appleton E<lt>bradapp@enteract.comE<gt>
93 Based on code for B<Pod::Text::pod2text(1)> written by
94 Tom Christiansen E<lt>tchrist@mox.perl.comE<gt>
110 GetOptions(\%options, "help", "man") || pod2usage(2);
111 pod2usage(1) if ($options{help});
112 pod2usage(-verbose => 2) if ($options{man});
114 ## Dont default to STDIN if connected to a terminal
115 pod2usage(2) if ((@ARGV == 0) && (-t STDIN));
117 ## Invoke podchecker()
119 for (@ARGV) { podchecker($_) };
121 podchecker("<&STDIN");
126 close OUT or die "Can't close $file: $!";
127 chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
128 exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';