############################################################################# # Select.pm -- function to select portions of pod docs # # Based on Tom Christiansen's pod2text() function # (with extensive modifications). # # Copyright (C) 1996 Tom Christiansen. All rights reserved. # This file is part of "PodParser". PodParser is free software; # you can redistribute it and/or modify it under the same terms # as Perl itself. ############################################################################# package PDL::Pod::Select; $VERSION = 1.00; ## Current version of this package require 5.002; ## requires Perl version 5.002 or later =head1 NAME podselect - function to extract selected sections of pod documentation =head1 SYNOPSIS use PDL::Pod::Select; podselect (@filelist); podselect ({OUTPUT => "tmp.out"}, @filelist): podselect ({SELECT => ["NAME|SYNOPSIS", "OPTIONS"]}, @filelist): podselect ({OUTPUT => ">&STDERR", SELECT => ["DESCRIPTION"]}, "-"); =head1 DESCRIPTION B is a function which will extract specified sections of pod documentation from an input stream. This ability is already provided in the B module. Subclasses of B that wish to take advantage of this feature do I need to derive from B. B merely provides a single function named B which provides this capability in function form (as opposed to object form) for extracting the raw pod docs. =cut ############################################################################# use Exporter (); use PDL::Pod::Parser; @ISA = qw(Exporter); @EXPORT = qw(&podselect); use strict; use diagnostics; use Carp; sub version { no strict; return $VERSION; } =head2 podselect(\%options, @filelist) B will print the raw (untranslated) pod documentation of all pod sections in the given input files specified by C<@filelist> according to the given options. If any argument to B is a reference to a hash (associative array) then the values with the following keys are processed as follows: =over 4 =item C A string corresponding to the desired output file (or ">&STDOUT" or ">&STDERR"). The default is to use standard output. =item C