I'm trying to print the POD as a "usage statement" if the correct parameters aren't passed to the subroutine, but I only want to print the POD which relates to the specific subroutine (I only want to print HelpFOO, not HelpFOO and HelpBAR). Any ideas? Thanks!#!C:/Perl/bin/perl.exe -w use strict; use warnings; use Pod::Text; #------------------------------ =pod =head2 HelpFOO ($status) = FOO($input); Input $input = the first parameter Output status (Success) - 0 (Failure) - non zero Description Description of what FOO does Usage: FOO(input) =cut #------------------------------ sub FOO { my $input = shift; if (!defined($input)){ my $parser = Pod::Text-> new(sentance=>,width=>78); $parser->parse_from_file($0, "-"); } } #------------------------------ =pod =head2 HelpBAR ($status) = BAR($input); Input $input = the first parameter Output status (Success) - 0 (Failure) - non zero Description Description of what BAR does Usage: BAR(input) =cut #------------------------------ sub BAR { my $input = shift; if (!defined($input)){ my $parser = Pod::Text-> new(sentance=>,width=>78); $parser->parse_from_file($0, "-"); } } #execute FOO();
In reply to Parsing Pod::Text by neo1491
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |