#!/usr/bin/perl -w use strict; use Pod::Select; # perl 5.8 feature, open a scalar as a filehandle open my $fh_out, '>', \my $pod or die "Couldn't open filehandle: $!"; my $fh_in = \*DATA; my $parser = Pod::Select->new(); $parser->parse_from_filehandle($fh_in, $fh_out); print $pod; __DATA__ # Some code my $foo = 'bar'; =head1 This is a B This is a paragraph. This is a verbatim section. This is I> paragraph =cut