#!/usr/local/bin/perl use warnings; use strict; use Pod::Parser; use Pod::InputObjects; package MyParser; our @ISA = qw(Pod::Parser); my $getting_desc = 0; sub command { my ($parser, $command, $paragraph, $line_num) = @_; if ($command eq 'head1' and $paragraph =~ /DESCRIPTION/) { $getting_desc = 1; } } sub verbatim {} sub textblock { my ($parser, $paragraph, $line_num, $pod_para) = @_; if ($getting_desc) { print $parser->interpolate($paragraph, $line_num); $getting_desc = 0; } } sub interior_sequence { my ($parser, $seq_command, $seq_argument) = @_; return $seq_argument; } package main; ## Create a parser object and have it parse file whose name was ## given on the command-line (use STDIN if no files were given). my $parser = new MyParser(); $parser->parse_from_filehandle(\*STDIN) if (@ARGV == 0); for (@ARGV) { $parser->parse_from_file($_); }