#############################################################################
# Pod/Checker.pm -- check pod documents for syntax errors
#
-# Copyright (C) 1994-1999 by Bradford Appleton. All rights reserved.
+# Copyright (C) 1994-2000 by Bradford Appleton. 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.
use vars qw($VERSION);
$VERSION = 1.098; ## Current version of this package
-require 5.004; ## requires this Perl version or later
+require 5.005; ## requires this Perl version or later
use Pod::ParseUtils; ## for hyperlinks and lists
use vars qw($VERSION);
$VERSION = 0.11; ## Current version of this package
-require 5.004; ## requires this Perl version or later
+require 5.005; ## requires this Perl version or later
#############################################################################
package Pod::InputObjects;
use vars qw($VERSION);
-$VERSION = 1.11; ## Current version of this package
-require 5.004; ## requires this Perl version or later
+$VERSION = 1.12; ## Current version of this package
+require 5.005; ## requires this Perl version or later
#############################################################################
my ($self, @children) = @_;
## Make sure any sequences know who their parent is
for (@children) {
- next if (!ref || ref eq 'SCALAR');
+ next unless (length and ref and ref ne 'SCALAR');
if (UNIVERSAL::isa($_, 'Pod::InteriorSequence') or
UNIVERSAL::can($_, 'nested'))
{
=head1 SEE ALSO
-See L<Pod::Parser>, L<Pod::Select>, and L<Pod::Callbacks>.
+See L<Pod::Parser>, L<Pod::Select>
=head1 AUTHOR
use vars qw($VERSION);
$VERSION = 0.2; ## Current version of this package
-require 5.004; ## requires this Perl version or later
+require 5.005; ## requires this Perl version or later
=head1 NAME
package Pod::Parser;
use vars qw($VERSION);
-$VERSION = 1.11; ## Current version of this package
-require 5.004; ## requires this Perl version or later
+$VERSION = 1.12; ## Current version of this package
+require 5.005; ## requires this Perl version or later
#############################################################################
=head1 REQUIRES
-perl5.004, Pod::InputObjects, Exporter, Carp
+perl5.005, Pod::InputObjects, Exporter, Symbol, Carp
=head1 EXPORTS
use Carp;
use Exporter;
require VMS::Filespec if $^O eq 'VMS';
+BEGIN {
+ if ($] < 5.6) {
+ require Symbol;
+ import Symbol;
+ }
+}
@ISA = qw(Exporter);
## These "variables" are used as local "glob aliases" for performance
my $self = shift;
my %opts = (ref $_[0] eq 'HASH') ? %{ shift() } : ();
my ($infile, $outfile) = @_;
- my ($in_fh, $out_fh);
+ my ($in_fh, $out_fh) = (gensym, gensym) if ($] < 5.6);
my ($close_input, $close_output) = (0, 0);
local *myData = $self;
local $_;
elsif (ref $outfile) {
## Must be a filehandle-ref (or else assume its a ref to an
## object that supports the common IO write operations).
- $myData{_OUTFILE} = ${$outfile};;
+ $myData{_OUTFILE} = ${$outfile};
$out_fh = $outfile;
}
else {
## We have a filename, open it for writing
$myData{_OUTFILE} = $outfile;
+ (-d $outfile) and croak "$outfile is a directory, not POD input!\n";
open($out_fh, "> $outfile") or
croak "Can't open $outfile for writing: $!\n";
$close_output = 1;
package Pod::Select;
use vars qw($VERSION);
-$VERSION = 1.11; ## Current version of this package
-require 5.004; ## requires this Perl version or later
+$VERSION = 1.12; ## Current version of this package
+require 5.005; ## requires this Perl version or later
#############################################################################
=head1 REQUIRES
-perl5.004, Pod::Parser, Exporter, Carp
+perl5.005, Pod::Parser, Exporter, Carp
=head1 EXPORTS
package Pod::Usage;
use vars qw($VERSION);
-$VERSION = 1.11; ## Current version of this package
-require 5.004; ## requires this Perl version or later
+$VERSION = 1.12; ## Current version of this package
+require 5.005; ## requires this Perl version or later
=head1 NAME
my $INSTDIR = abs_path(dirname $0);
$INSTDIR = VMS::Filespec::unixpath($INSTDIR) if $^O eq 'VMS';
$INSTDIR =~ s#/$## if $^O eq 'VMS';
-$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, 'pod'),
- catfile($INSTDIR, 't', 'pod'),
- catfile($INSTDIR, 't', 'pod', 'xtra')
+ catfile($INSTDIR, 't', 'pod')
);
## Find the path to the file to =include
print $out_fh "###### end =include $incbase #####\n" if ($incdebug);
}
+sub begin_input {
+ $_[0]->{_INFILE} = VMS::Filespec::unixify($_[0]->{_INFILE}) if $^O eq 'VMS';
+}
+
sub podinc2plaintext( $ $ ) {
my ($infile, $outfile) = @_;
local $_;
import TestCompare;
my $PARENTDIR = dirname $THISDIR;
push @INC, map { File::Spec->catfile($_, 'lib') } ($PARENTDIR, $THISDIR);
+ require VMS::Filespec if $^O eq 'VMS';
}
use Pod::Checker;
}
sub msgcmp( $ $ ) {
+ ## filter out platform-dependent aspects of error messages
my ($line1, $line2) = @_;
+ for ($line1, $line2) {
+ if ( /^#*\s*(\S.*?)\s+(?:has \d+\s*)?pod syntax (?:error|OK)/ ) {
+ my $fname = $1;
+ s/^#*\s*// if ($^O eq 'MacOS');
+ s/^\s*\Q$fname\E/stripname($fname)/e;
+ }
+ elsif ( /^#*\s*\*+\s*(?:ERROR|Unterminated)/ ) {
+ s/^#*\s*// if ($^O eq 'MacOS');
+ s/of file\s+(\S.*?)\s*$/"of file ".stripname($1)/e;
+ s/at\s+(\S.*?)\s+line/"at ".stripname($1)." line"/e;
+ }
+ }
return $line1 ne $line2;
}
print "# Running podchecker for '$testname'...\n";
## Compare the output against the expected result
+ if ($^O eq 'VMS') {
+ for ($infile, $outfile, $cmpfile) {
+ $_ = VMS::Filespec::unixify($_) unless ref;
+ }
+ }
podchecker($infile, $outfile);
if ( testcmp({'-cmplines' => \&msgcmp}, $outfile, $cmpfile) ) {
$different = "$outfile is different from $cmpfile";