#!/usr/bin/perl use strict; use warnings; use Pod::POM; use Pod::POM::View::Text; my $pom = Pod::POM->new(); my $pod = $pom->parse_file($ARGV[0]); foreach my $head1 (grep { /Listing/ } $pod->head1()) { my $i = 0; my @command; foreach my $head2 ($head1->head2) { ($command[$i], undef) = split ' ', $head2->title; if ($command[$i] =~ /^X', $command[$i]; } open (HELP, ">help/".$command[$i]); my $content = $head2->present('Pod::POM::View::Text'); print HELP $content; close HELP; $i++; } }