package Pod::Checker;
use vars qw($VERSION);
-$VERSION = 1.08; ## Current version of this package
+$VERSION = 1.081; ## Current version of this package
require 5.004; ## requires this Perl version or later
=head1 NAME
package Pod::InputObjects;
use vars qw($VERSION);
-$VERSION = 1.08; ## Current version of this package
+$VERSION = 1.081; ## Current version of this package
require 5.004; ## requires this Perl version or later
#############################################################################
my ($self, @children) = @_;
## Make sure any sequences know who their parent is
for (@children) {
- next unless ref $_;
+ next unless ref;
if ($_->isa('Pod::InteriorSequence') or $_->can('nested')) {
$_->nested($self);
}
$self->{'-parent_sequence'} = undef;
my $ptree = $self->{'-ptree'};
for (@$ptree) {
- next unless ($_ and ref $_ and $_->isa('Pod::InteriorSequence'));
+ next unless (length and ref and $_->isa('Pod::InteriorSequence'));
$_->_unset_child2parent_links();
}
}
my $self = shift;
local *ptree = $self;
for (@_) {
- next unless $_;
+ next unless length;
if (@ptree and !(ref $ptree[0]) and !(ref $_)) {
$ptree[0] = $_ . $ptree[0];
}
my $self = shift;
local *ptree = $self;
for (@_) {
- next unless $_;
+ next unless length;
if (@ptree and !(ref $ptree[-1]) and !(ref $_)) {
$ptree[-1] .= $_;
}
my $self = shift;
local *ptree = $self;
for (@ptree) {
- next unless ($_ and ref $_ and $_->isa('Pod::InteriorSequence'));
+ next unless (length and ref and $_->isa('Pod::InteriorSequence'));
$_->_unset_child2parent_links();
}
}
package Pod::Parser;
use vars qw($VERSION);
-$VERSION = 1.08; ## Current version of this package
+$VERSION = 1.081; ## Current version of this package
require 5.004; ## requires this Perl version or later
#############################################################################
## an interior sequence looks like '-' or '=', but not '--' or '=='
use vars qw( $ARROW_RE );
$ARROW_RE = join('', qw{ (?: [^=]+= | [^-]+- )$ });
+#$ARROW_RE = qr/(?:[^=]+=|[^-]+-)$/; ## 5.005+ only!
sub parse_text {
my $self = shift;
## Convert method calls into closures, for our convenience
my $xseq_sub = $expand_seq;
my $xptree_sub = $expand_ptree;
- if ($expand_seq eq 'interior_sequence') {
+ if (defined $expand_seq and $expand_seq eq 'interior_sequence') {
## If 'interior_sequence' is the method to use, we have to pass
## more than just the sequence object, we also need to pass the
## sequence name and text.
++$line if ($_ eq "\n");
## Look for the beginning of a sequence
if ( /^([A-Z])(<)$/ ) {
- ## Push a new sequence onto the stack on of those "in-progress"
+ ## Push a new sequence onto the stack of those "in-progress"
$seq = Pod::InteriorSequence->new(
-name => ($cmd = $1),
-ldelim => $2, -rdelim => '',
}
else {
## In the middle of a sequence, append this text to it
- $seq->append($_) if $_;
+ $seq->append($_) if length;
}
## Remember the "current" sequence and the previously seen token
($seq, $prev) = ( $seq_stack[-1], $_ );
package Pod::PlainText;
use vars qw($VERSION);
-$VERSION = 1.08; ## Current version of this package
+$VERSION = 1.081; ## Current version of this package
require 5.004; ## requires this Perl version or later
=head1 NAME
$line .= $_;
}
}
- $par .= "$line\n" if $line;
+ $par .= "$line\n" if length $line;
$par .= "\n";
return $par;
}
package Pod::Select;
use vars qw($VERSION);
-$VERSION = 1.08; ## Current version of this package
+$VERSION = 1.081; ## Current version of this package
require 5.004; ## requires this Perl version or later
#############################################################################
package Pod::Usage;
use vars qw($VERSION);
-$VERSION = 1.08; ## Current version of this package
+$VERSION = 1.081; ## Current version of this package
require 5.004; ## requires this Perl version or later
=head1 NAME
## User passed a ref to a hash
%opts = %{$_} if (ref($_) eq 'HASH');
}
- elsif (/^[-+]?\d+$/o) {
+ elsif (/^[-+]?\d+$/) {
## User passed in the exit value to use
$opts{"-exitval"} = $_;
}
local $_ = shift;
my $line = shift;
## See if this is a heading and we arent printing the entire manpage.
- if (($self->{USAGE_OPTIONS}->{-verbose} < 2) && /^=head/o) {
+ if (($self->{USAGE_OPTIONS}->{-verbose} < 2) && /^=head/) {
## Change the title of the SYNOPSIS section to USAGE
- s/^=head1\s+SYNOPSIS\s*$/=head1 USAGE/o;
+ s/^=head1\s+SYNOPSIS\s*$/=head1 USAGE/;
## Try to do some lowercasing instead of all-caps in headings
s{([A-Z])([A-Z]+)}{((length($2) > 2) ? $1 : lc($1)) . lc($2)}ge;
## Use a colon to end all headings
- s/\s*$/:/o unless (/:\s*$/o);
+ s/\s*$/:/ unless (/:\s*$/);
$_ .= "\n";
}
return $self->SUPER::preprocess_paragraph($_);
Dont forget C<$self-E<gt>method()-E<gt>{FIELDNAME} = {FOO=E<gt>BAR}>.
+And make sure that C<0> works too!
+
=cut
Dont forget `$self->method()->{FIELDNAME} = {FOO=>BAR}'.
+ And make sure that `0' works too!
+
BEGIN {
use File::Basename;
use File::Spec;
+ use Cwd qw(abs_path);
push @INC, '..';
- my $THISDIR = dirname $0;
+ my $THISDIR = abs_path(dirname $0);
unshift @INC, $THISDIR;
require "testcmp.pl";
import TestCompare;
use Carp;
use Exporter;
#use File::Compare;
+#use Cwd qw(abs_path);
@ISA = qw(Pod::PlainText);
@EXPORT = qw(&testpodplaintext);
sub catfile(@) { File::Spec->catfile(@_); }
+my $INSTDIR = abs_path(dirname $0);
+$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'xtra');
+$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod');
+$INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't');
+my @PODINCDIRS = ( catfile($INSTDIR, 'lib', 'Pod'),
+ catfile($INSTDIR, 'scripts'),
+ catfile($INSTDIR, 't', 'pod'),
+ catfile($INSTDIR, 't', 'pod', 'xtra')
+ );
+
## Find the path to the file to =include
sub findinclude {
my $self = shift;
## 1. the directory containing this pod file
my $thispoddir = dirname $self->input_file;
## 2. the parent directory of the above
- my $parentdir = ($thispoddir eq '.') ? '..' : dirname $thispoddir;
- ## 3. any Pod/ or scripts/ subdirectory of these two
- my @dirs = ();
- for ($thispoddir, $parentdir) {
- my $dir = $_;
- for ( qw(scripts lib) ) {
- push @dirs, $dir, catfile($dir, $_),
- catfile($dir, 'Pod'),
- catfile($dir, $_, 'Pod');
- }
- }
- my %dirs = (map { ($_ => 1) } @dirs);
- my @podincdirs = (sort keys %dirs);
+ my $parentdir = dirname $thispoddir;
+ my @podincdirs = ($thispoddir, $parentdir, @PODINCDIRS);
for (@podincdirs) {
my $incfile = catfile($_, $incname);