| 1 |
#!perl -w |
| 2 |
|
| 3 |
# |
| 4 |
# Strip POD documentation out of base modules |
| 5 |
# |
| 6 |
# We install separate copies of these modules with the documentation intact |
| 7 |
# into libperl5.xx / perl-modules-5.xx, which are pulled in by perl-doc |
| 8 |
# |
| 9 |
|
| 10 |
use strict; |
| 11 |
use File::Find; |
| 12 |
use File::Path; |
| 13 |
|
| 14 |
my @args = @ARGV; |
| 15 |
@ARGV = (); |
| 16 |
find sub { push @ARGV, $File::Find::name if -f and /\.pm$/ }, @args; |
| 17 |
die "$0: no modules under @args?\n" unless @ARGV; |
| 18 |
|
| 19 |
$^I = ''; |
| 20 |
$/ = ''; |
| 21 |
|
| 22 |
my $in_pod; |
| 23 |
my $pod; |
| 24 |
|
| 25 |
while (<>) |
| 26 |
{ |
| 27 |
if ($in_pod ||= /^=\w/) |
| 28 |
{ |
| 29 |
|
| 30 |
if (/^=cut\n/) |
| 31 |
{ |
| 32 |
$in_pod = 0; |
| 33 |
} |
| 34 |
else |
| 35 |
{ |
| 36 |
next; |
| 37 |
} |
| 38 |
} |
| 39 |
else |
| 40 |
{ |
| 41 |
print; |
| 42 |
} |
| 43 |
} |
| 44 |
continue |
| 45 |
{ |
| 46 |
if (eof) |
| 47 |
{ |
| 48 |
close ARGV; |
| 49 |
$in_pod = 0; |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
exit |