#!/usr/bin/perl # $Id: genhelp.pl,v 1.3 2007/04/18 18:03:18 root dead $ 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 { /Command/ } $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, ">".$ARGV[1]."/".$command[$i]); my $content = $head2->present('Pod::POM::View::Text'); print HELP $content; close HELP; $i++; } }