1 |
#!/usr/bin/perl |
2 |
|
3 |
use strict; |
4 |
use warnings; |
5 |
use Pod::POM; |
6 |
use Pod::POM::View::Text; |
7 |
|
8 |
my $pom = Pod::POM->new(); |
9 |
my $pod = $pom->parse_file($ARGV[0]); |
10 |
|
11 |
foreach my $head1 (grep { /Listing/ } $pod->head1()) { |
12 |
my $i = 0; |
13 |
my @command; |
14 |
foreach my $head2 ($head1->head2) { |
15 |
($command[$i], undef) = split ' ', $head2->title; |
16 |
if ($command[$i] =~ /^X</) { |
17 |
(undef, $command[$i]) = split '>', $command[$i]; |
18 |
} |
19 |
open (HELP, ">help/".$command[$i]); |
20 |
my $content = $head2->present('Pod::POM::View::Text'); |
21 |
print HELP $content; |
22 |
close HELP; |
23 |
$i++; |
24 |
} |
25 |
} |