in reply to Extract selected sections of POD
You might want to take a look at how Pod::Usage does it. The following is a bit of a hack in that it doesn't use the module for its real purpose, but perhaps it's close to what you're looking for?
use warnings; use strict; use Pod::Usage; =head1 SYNOPSIS Synopsis =head1 FOO Foo! =head1 BAR Bar! =head1 QUZ Quz! =cut open my $fh, '>', \my $str or die $!; pod2usage(-exitval=>'NOEXIT',-verbose=>99,-output=>$fh, -sections=>['FOO','QUZ']); close $fh; print "<<$str>>\n"; __END__ <<foo: Foo! quz: Quz! >>
|
|---|