This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: Patch for ASN.1 compressed integer in pack/unpack
[perl5.git] / pod / splitpod
CommitLineData
cb1a09d0
AD
1#!/usr/bin/perl
2
6ec7a3ca 3use lib '../lib'; # If you haven't installed perl yet.
4use Pod::Functions;
cb1a09d0
AD
5
6local $/ = '';
7
8$cur = '';
9while (<>) {
10
11 next unless /^=(?!cut)/ .. /^=cut/;
12
13 if (s/=item (\S+)/$1/) {
14 #$cur = "POSIX::" . $1;
15 $cur = $1;
16 $syn{$cur} .= $_;
17 next;
18 } else {
19 #s,L</,L<POSIX/,g;
20 s,L</,L<perlfunc/,g;
21 $pod{$cur} .= $_ if $cur;
22 }
23}
24
25for $f ( keys %syn ) {
26 $type = $Type{$f} || next;
27 $flavor = $Flavor{$f};
28 $orig = $f;
29 ($name = $f) =~ s/\W//g;
30 open (POD, "> $name.pod") || die "can't open $name.pod: $!";
31 print POD <<EOF;
32=head1 NAME
33
34$orig - $flavor
35
36=head1 SYNOPSIS
37
38$syn{$orig}
39
40=head1 DESCRIPTION
41
42$pod{$orig}
43
44EOF
45
46 close POD;
47
48}