| 1 | #!/usr/local/bin/perl
|
|---|
| 2 |
|
|---|
| 3 | use Config;
|
|---|
| 4 | use File::Basename qw(&basename &dirname);
|
|---|
| 5 | use Cwd;
|
|---|
| 6 |
|
|---|
| 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
|
|---|
| 11 | # $startperl
|
|---|
| 12 | # to ensure Configure will look for $Config{startperl}.
|
|---|
| 13 |
|
|---|
| 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.
|
|---|
| 16 | $origdir = cwd;
|
|---|
| 17 | chdir(dirname($0));
|
|---|
| 18 | $file = basename($0, '.PL');
|
|---|
| 19 | $file .= '.com' if $^O eq 'VMS';
|
|---|
| 20 |
|
|---|
| 21 | open OUT,">$file" or die "Can't create $file: $!";
|
|---|
| 22 |
|
|---|
| 23 | print "Extracting $file (with variable substitutions)\n";
|
|---|
| 24 |
|
|---|
| 25 | # In this section, perl variables will be expanded during extraction.
|
|---|
| 26 | # You can use $Config{...} to use Configure variables.
|
|---|
| 27 |
|
|---|
| 28 | print OUT <<"!GROK!THIS!";
|
|---|
| 29 | $Config{'startperl'}
|
|---|
| 30 | eval 'exec perl -S \$0 "\$@"'
|
|---|
| 31 | if 0;
|
|---|
| 32 | !GROK!THIS!
|
|---|
| 33 |
|
|---|
| 34 | # In the following, perl variables are not expanded during extraction.
|
|---|
| 35 |
|
|---|
| 36 | print OUT <<'!NO!SUBS!';
|
|---|
| 37 |
|
|---|
| 38 | #############################################################################
|
|---|
| 39 | # pod2usage -- command to print usage messages from embedded pod docs
|
|---|
| 40 | #
|
|---|
| 41 | # Copyright (c) 1996-2000 by Bradford Appleton. All rights reserved.
|
|---|
| 42 | # This file is part of "PodParser". PodParser is free software;
|
|---|
| 43 | # you can redistribute it and/or modify it under the same terms
|
|---|
| 44 | # as Perl itself.
|
|---|
| 45 | #############################################################################
|
|---|
| 46 |
|
|---|
| 47 | use strict;
|
|---|
| 48 | use diagnostics;
|
|---|
| 49 |
|
|---|
| 50 | =head1 NAME
|
|---|
| 51 |
|
|---|
| 52 | pod2usage - print usage messages from embedded pod docs in files
|
|---|
| 53 |
|
|---|
| 54 | =head1 SYNOPSIS
|
|---|
| 55 |
|
|---|
| 56 | =over 12
|
|---|
| 57 |
|
|---|
| 58 | =item B<pod2usage>
|
|---|
| 59 |
|
|---|
| 60 | [B<-help>]
|
|---|
| 61 | [B<-man>]
|
|---|
| 62 | [B<-exit>S< >I<exitval>]
|
|---|
|
|---|