package Pod::Parser;
use vars qw($VERSION);
-$VERSION = 1.12; ## Current version of this package
+$VERSION = 1.13; ## Current version of this package
require 5.005; ## requires this Perl version or later
#############################################################################
## Iterate over all sequence starts text (NOTE: split with
## capturing parens keeps the delimiters)
$_ = $text;
- my @tokens = split /([A-Z]<(?:<+\s+)?)/;
+ my @tokens = split /([A-Z]<(?:<+\s)?)/;
while ( @tokens ) {
$_ = shift @tokens;
## Look for the beginning of a sequence
- if ( /^([A-Z])(<(?:<+\s+)?)$/ ) {
+ if ( /^([A-Z])(<(?:<+\s)?)$/ ) {
## Push a new sequence onto the stack of those "in-progress"
($cmd, $ldelim) = ($1, $2);
$seq = Pod::InteriorSequence->new(
package Pod::Usage;
use vars qw($VERSION);
-$VERSION = 1.13; ## Current version of this package
+$VERSION = 1.14; ## Current version of this package
require 5.005; ## requires this Perl version or later
=head1 NAME
=item C<-exitval>
The desired exit status to pass to the B<exit()> function.
+This should be an integer, or else the string "NOEXIT" to
+indicate that control should simply be returned without
+terminating the invoking process.
=item C<-verbose>
use strict;
#use diagnostics;
use Carp;
+use Config;
use Exporter;
use File::Spec;
}
## Now translate the pod document and then exit with the desired status
- $parser->parse_from_file($opts{"-input"}, $opts{"-output"});
- exit($opts{"-exitval"});
+ if ( $opts{"-verbose"} >= 2
+ and !ref($opts{"-input"})
+ and $opts{"-output"} == \*STDOUT )
+ {
+ ## spit out the entire PODs. Might as well invoke perldoc
+ my $progpath = File::Spec->catfile($Config{bin}, "perldoc");
+ system($progpath, $opts{"-input"});
+ }
+ else {
+ $parser->parse_from_file($opts{"-input"}, $opts{"-output"});
+ }
+
+ exit($opts{"-exitval"}) unless (lc($opts{"-exitval"}) eq 'noexit');
}
##---------------------------------------------------------------------------