"Fossies" - the Fresh Open Source Software Archive

Member "perl-5.32.1/pod/splitman" (18 Dec 2020, 644 Bytes) of package /linux/misc/perl-5.32.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/perl
    2 
    3 while (<>) {
    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
   25 EOALL
   26     } else {
   27         print MAN <<EOMORE;
   28 .br
   29 .ti +3n
   30 or
   31 .br
   32 .B $desc
   33 EOMORE
   34     } 
   35     next;
   36     } 
   37     unless ($desking) {
   38     print MAN ".SH DESCRIPTION\n";
   39     $desking = 1;
   40     } 
   41     print MAN;
   42 } 
   43 
   44 sub name {
   45     ($_[0] =~ /(\w+)/)[0];
   46 }