extra code in pp_concat, Take 2
[p5sagit/p5-mst-13.2.git] / pod / splitman
CommitLineData
a0d0e21e 1#!/usr/bin/perl
2
3while (<>) {
4 if ($seqno = 1 .. /^\.TH/) {
5 unless ($seqno =~ /e/i) {
6 $header .= $_;
7 }
8 next;
9 }
10
11 if ( /^\.Ip\s*"(.*)"\s*\d+$/) {
12 $desking = 0;
13 $desc = $1;
14 if (name($desc) ne $myname) {
15 $myname = name($desc);
16 print $myname, "\n";
17 open(MAN, "> $myname.3pl");
18 print MAN <<EOALL;
19$header
20.TH $myname 3PL "\\*(RP"
21.SH NAME
22$myname
23.SH SYNOPSIS
24.B $desc
25EOALL
26 } else {
27 print MAN <<EOMORE;
28.br
29.ti +3n
30or
31.br
32.B $desc
33EOMORE
34 }
35 next;
36 }
37 unless ($desking) {
38 print MAN ".SH DESCRIPTION\n";
39 $desking = 1;
40 }
41 print MAN;
42}
43
44sub name {
45 ($_[0] =~ /(\w+)/)[0];
46}