and lib/Pod/t/utils.t to cater for simpler output text.
p4raw-id: //depot/perl@18224
package Pod::Checker;
use vars qw($VERSION);
-$VERSION = 1.3; ## Current version of this package
+$VERSION = 1.40; ## Current version of this package
require 5.005; ## requires this Perl version or later
use Pod::ParseUtils; ## for hyperlinks and lists
with the script/module name, followed by a dash `-' and a very short
description of what the thing is good for.
+=item * =headI<n> without preceding higher level
+
+For example if there is a C<=head2> in the POD file prior to a
+C<=head1>.
+
=back
=head2 Hyperlinks
## Initialize number of errors, and setup an error function to
## increment this number and then print to the designated output.
$self->{_NUM_ERRORS} = 0;
+ $self->{_NUM_WARNINGS} = 0;
$self->{-quiet} ||= 0;
# set the error handling subroutine
$self->errorsub($self->{-quiet} ? sub { 1; } : 'poderror');
## Increment error count and print message "
++($self->{_NUM_ERRORS})
if(!%opts || ($opts{-severity} && $opts{-severity} eq 'ERROR'));
+ ++($self->{_NUM_WARNINGS})
+ if(!%opts || ($opts{-severity} && $opts{-severity} eq 'WARNING'));
my $out_fh = $self->output_handle() || \*STDERR;
print $out_fh ($severity, $msg, $line, $file, "\n")
if($self->{-warnings} || !%opts || $opts{-severity} ne 'WARNING');
##################################
+=item C<$checker-E<gt>num_warnings()>
+
+Set (if argument specified) and retrieve the number of warnings found.
+
+=cut
+
+sub num_warnings {
+ return (@_ > 1) ? ($_[0]->{_NUM_WARNINGS} = $_[1]) : $_[0]->{_NUM_WARNINGS};
+}
+
+##################################
+
=item C<$checker-E<gt>name()>
Set (if argument specified) and retrieve the canonical name of POD as
}
}
elsif($cmd =~ /^head(\d+)/) {
+ my $hnum = $1;
+ $self->{"_have_head_$hnum"}++; # count head types
+ if($hnum > 1 && !$self->{"_have_head_".($hnum -1)}) {
+ $self->poderror({ -line => $line, -file => $file,
+ -severity => 'WARNING',
+ -msg => "=head$hnum without preceding higher level"});
+ }
# check whether the previous =head section had some contents
if(defined $self->{_commands_in_head} &&
$self->{_commands_in_head} == 0 &&
defined $self->{_last_head} &&
- $self->{_last_head} >= $1) {
+ $self->{_last_head} >= $hnum) {
$self->poderror({ -line => $line, -file => $file,
-severity => 'WARNING',
-msg => "empty section in previous paragraph"});
}
$self->{_commands_in_head} = -1;
- $self->{_last_head} = $1;
+ $self->{_last_head} = $hnum;
# check if there is an open list
if(@{$self->{_list_stack}}) {
my $list;
package Pod::ParseUtils;
use vars qw($VERSION);
-$VERSION = 0.22; ## Current version of this package
+$VERSION = 0.30; ## Current version of this package
require 5.005; ## requires this Perl version or later
=head1 NAME
my $self = shift;
local($_) = $_[0];
# syntax check the link and extract destination
- my ($alttext,$page,$node,$type) = (undef,'','','');
+ my ($alttext,$page,$node,$type,$quoted) = (undef,'','','',0);
$self->{_warnings} = [];
# problem: a lot of people use (), or (1) or the like to indicate
# man page sections. But this collides with L<func()> that is supposed
# to point to an internal funtion...
- my $page_rx = '[\w.]+(?:::[\w.]+)*(?:[(](?:\d\w*|)[)]|)';
+ my $page_rx = '[\w.-]+(?:::[\w.-]+)*(?:[(](?:\d\w*|)[)]|)';
# page name only
if(m!^($page_rx)$!o) {
$page = $1;
elsif(m!^(.*?)\s*[|]\s*($page_rx)\s*/\s*"(.+)"$!o) {
($alttext, $page, $node) = ($1, $2, $3);
$type = 'section';
+ $quoted = 1; #... therefore | and / are allowed
}
# alttext and page
elsif(m!^(.*?)\s*[|]\s*($page_rx)$!o) {
elsif(m!^(.*?)\s*[|]\s*(?:/\s*|)"(.+)"$!) {
($alttext, $node) = ($1,$2);
$type = 'section';
+ $quoted = 1;
}
# page and "section"
elsif(m!^($page_rx)\s*/\s*"(.+)"$!o) {
($page, $node) = ($1, $2);
$type = 'section';
+ $quoted = 1;
}
# page and item
elsif(m!^($page_rx)\s*/\s*(.+)$!o) {
elsif(m!^/?"(.+)"$!) {
$node = $1;
$type = 'section';
+ $quoted = 1;
}
# only item
elsif(m!^\s*/(.+)$!) {
if($page =~ /[(]\w*[)]$/) {
$self->warning("(section) in '$page' deprecated");
}
- if($node =~ m:[|/]:) {
+ if(!$quoted && $node =~ m:[|/]:) {
$self->warning("node '$node' contains non-escaped | or /");
}
if($alttext =~ m:[|/]:) {
$self->{_text} = $section;
}
else {
- $self->{_text} = (!$section ? '' :
- $type eq 'item' ? "the $section entry" :
- "the section on $section" ) .
- ($page ? ($section ? ' in ':'') . "the $page$page_ext manpage" :
- ' elsewhere in this document');
+ $self->{_text} = ($section || '') .
+ (($page && $section) ? ' in ' : '') .
+ "$page$page_ext";
}
# for being marked up later
# use the non-standard markers P<> and Q<>, so that the resulting
$self->{_markup} = "Q<$section>";
}
else {
- $self->{_markup} = (!$section ? '' :
- $type eq 'item' ? "the Q<$section> entry" :
- "the section on Q<$section>" ) .
- ($page ? ($section ? ' in ':'') . "the P<$page>$page_ext manpage" :
- ' elsewhere in this document');
+ $self->{_markup} = (!$section ? '' : "Q<$section>") .
+ ($page ? ($section ? ' in ':'') . "P<$page>$page_ext" : '');
}
}
the following alternatives (the + and * denote the portions of the text
that are marked up):
- the +perl+ manpage
- the *$|* entry in the +perlvar+ manpage
- the section on *OPTIONS* in the +perldoc+ manpage
- the section on *DESCRIPTION* elsewhere in this document
+ +perl+ L<perl>
+ *$|* in +perlvar+ L<perlvar/$|>
+ *OPTIONS* in +perldoc+ L<perldoc/"OPTIONS">
+ *DESCRIPTION* L<"DESCRIPTION">
=cut
and $opts{"-output"} == \*STDOUT )
{
## spit out the entire PODs. Might as well invoke perldoc
- my $progpath = File::Spec->catfile($Config{scriptdir}, "perldoc");
+ my $progpath = File::Spec->catfile($Config{bin}, "perldoc");
system($progpath, $opts{"-input"});
}
else {
-Standard link: the \emph{Pod::LaTeX} manpage.
+Standard link: \emph{Pod::LaTeX}.
-Now refer to an external section: the section on \textsf{sec} in the \emph{Pod::LaTeX} manpage
+Now refer to an external section: \textsf{sec} in \emph{Pod::LaTeX}
\section{Lists\label{Lists}\index{Lists}}
};
my @results = (
- "the P<name> manpage",
- "the Q<ident> entry in the P<name> manpage",
- "the section on Q<sec> in the P<name> manpage",
- "the section on Q<sec> elsewhere in this document",
- "the section on Q<sec> elsewhere in this document",
+ "P<name>",
+ "Q<ident> in P<name>",
+ "Q<sec> in P<name>",
+ "Q<sec>",
+ "Q<sec>",
"Q<http://www.perl.org/>",
"Q<text>",
"Q<text>",
=item B<-section>S< >I<section-spec>
Specify a section to include in the output.
-See L<Pod::Select/"SECTION SPECIFICATIONS">
+See L<Pod::Parser/"SECTION SPECIFICATIONS">
for the format to use for I<section-spec>.
This option may be given multiple times on the command line.
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
Try out *LOTS* of different ways of specifying references:
- Reference the "section" in manpage
+ Reference the the section entry in the manpage manpage
- Reference the "section" in manpage
+ Reference the the section entry in the manpage manpage
- Reference the "section" in manpage
+ Reference the the section entry in the manpage manpage
- Reference the "section" in manpage
+ Reference the the section entry in the manpage manpage
- Reference the "manpage/section"
+ Reference the the section on "manpage/section"
- Reference the "section" in "manpage"
+ Reference the the section entry in the "manpage" manpage
- Reference the "section" in manpage
+ Reference the the section on "section" in the manpage manpage
- Reference the "section" in manpage
+ Reference the the section entry in the manpage manpage
- Reference the "section" in manpage
+ Reference the the section entry in the manpage manpage
Now try it using the new "|" stuff ...
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
appropriately.
This is a test.
-
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
specifed than standard input is read.
pod2usage invokes the pod2usage() function in the Pod::Usage module.
- Please see "pod2usage()" in Pod::Usage.
+ Please see the pod2usage() entry in the Pod::Usage manpage.
SEE ALSO
- Pod::Usage, pod2text(1)
+ the Pod::Usage manpage, the pod2text(1) manpage
AUTHOR
Brad Appleton <bradapp@enteract.com>
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testpchk.pl";
import TestPodChecker;
}
__END__
+=head2 This should cause a warning
=head1 NAME
blub is evil
-=head2 reoccurrence
+=head2 reoccurence
=over 4
previous section is empty!
+=head1 LINK TESTS
+
+Due to bug reported by Rafael Garcia-Suarez "rgarciasuarez@free.fr":
+
+The following hyperlinks :
+L<"I/O Operators">
+L<perlop/"I/O Operators">
+trigger a podchecker warning (using bleadperl) :
+ node 'I/O Operators' contains non-escaped | or /
+
=cut
-*** ERROR: Unknown command 'unknown1' at line 25 in file t/pod/poderrs.t
-*** ERROR: Unknown interior-sequence 'Q' at line 29 in file t/pod/poderrs.t
-*** ERROR: Unknown interior-sequence 'A' at line 30 in file t/pod/poderrs.t
-*** ERROR: Unknown interior-sequence 'Y' at line 31 in file t/pod/poderrs.t
-*** ERROR: Unknown interior-sequence 'V' at line 31 in file t/pod/poderrs.t
-*** ERROR: unterminated B<...> at line 35 in file t/pod/poderrs.t
-*** ERROR: unterminated I<...> at line 34 in file t/pod/poderrs.t
-*** ERROR: unterminated C<...> at line 37 in file t/pod/poderrs.t
-*** WARNING: line containing nothing but whitespace in paragraph at line 45 in file t/pod/poderrs.t
-*** ERROR: =item without previous =over at line 52 in file t/pod/poderrs.t
-*** ERROR: =back without previous =over at line 56 in file t/pod/poderrs.t
-*** ERROR: =over on line 60 without closing =back (at head2) at line 64 in file t/pod/poderrs.t
-*** ERROR: =end without =begin at line 66 in file t/pod/poderrs.t
-*** ERROR: Nested =begin's (first at line 70:html) at line 72 in file t/pod/poderrs.t
-*** ERROR: =end without =begin at line 76 in file t/pod/poderrs.t
-*** ERROR: No argument for =begin at line 82 in file t/pod/poderrs.t
-*** ERROR: =for without formatter specification at line 88 in file t/pod/poderrs.t
-*** ERROR: nested commands C<...C<...>...> at line 94 in file t/pod/poderrs.t
-*** ERROR: garbled entity E<alea iacta est> at line 98 in file t/pod/poderrs.t
-*** ERROR: garbled entity E<C<auml>> at line 99 in file t/pod/poderrs.t
-*** ERROR: garbled entity E<abcI<bla>> at line 100 in file t/pod/poderrs.t
-*** ERROR: Entity number out of range E<0x100> at line 101 in file t/pod/poderrs.t
-*** ERROR: Entity number out of range E<07777> at line 102 in file t/pod/poderrs.t
-*** ERROR: Entity number out of range E<300> at line 103 in file t/pod/poderrs.t
-*** ERROR: malformed link L<> : empty link at line 115 in file t/pod/poderrs.t
-*** WARNING: ignoring leading whitespace in link at line 116 in file t/pod/poderrs.t
-*** WARNING: ignoring trailing whitespace in link at line 117 in file t/pod/poderrs.t
-*** WARNING: (section) in 'passwd(5)' deprecated at line 123 in file t/pod/poderrs.t
-*** WARNING: node '$|' contains non-escaped | or / at line 124 in file t/pod/poderrs.t
-*** WARNING: alternative text '$|' contains non-escaped | or / at line 124 in file t/pod/poderrs.t
-*** ERROR: Spurious character(s) after =back at line 130 in file t/pod/poderrs.t
-*** ERROR: Nonempty Z<> at line 144 in file t/pod/poderrs.t
-*** ERROR: Empty X<> at line 146 in file t/pod/poderrs.t
-*** WARNING: preceding non-item paragraph(s) at line 152 in file t/pod/poderrs.t
-*** WARNING: No argument for =item at line 154 in file t/pod/poderrs.t
-*** WARNING: previous =item has no contents at line 156 in file t/pod/poderrs.t
-*** WARNING: No items in =over (at line 164) / =back list at line 166 in file t/pod/poderrs.t
-*** ERROR: Spurious text after =pod at line 172 in file t/pod/poderrs.t
-*** ERROR: Spurious text after =cut at line 176 in file t/pod/poderrs.t
-*** WARNING: empty section in previous paragraph at line 192 in file t/pod/poderrs.t
-*** ERROR: unresolved internal link 'begin or begin' at line 107 in file t/pod/poderrs.t
-*** ERROR: unresolved internal link 'end with begin' at line 108 in file t/pod/poderrs.t
-*** ERROR: unresolved internal link 'OoPs' at line 109 in file t/pod/poderrs.t
-*** ERROR: unresolved internal link 'abc def' at line 113 in file t/pod/poderrs.t
+*** WARNING: =head2 without preceding higher level at line 20 in file t/pod/poderrs.t
+*** WARNING: empty section in previous paragraph at line 22 in file t/pod/poderrs.t
+*** ERROR: Unknown command 'unknown1' at line 26 in file t/pod/poderrs.t
+*** ERROR: Unknown interior-sequence 'Q' at line 30 in file t/pod/poderrs.t
+*** ERROR: Unknown interior-sequence 'A' at line 31 in file t/pod/poderrs.t
+*** ERROR: Unknown interior-sequence 'Y' at line 32 in file t/pod/poderrs.t
+*** ERROR: Unknown interior-sequence 'V' at line 32 in file t/pod/poderrs.t
+*** ERROR: unterminated B<...> at line 36 in file t/pod/poderrs.t
+*** ERROR: unterminated I<...> at line 35 in file t/pod/poderrs.t
+*** ERROR: unterminated C<...> at line 38 in file t/pod/poderrs.t
+*** WARNING: line containing nothing but whitespace in paragraph at line 46 in file t/pod/poderrs.t
+*** ERROR: =item without previous =over at line 53 in file t/pod/poderrs.t
+*** ERROR: =back without previous =over at line 57 in file t/pod/poderrs.t
+*** ERROR: =over on line 61 without closing =back (at head2) at line 65 in file t/pod/poderrs.t
+*** ERROR: =end without =begin at line 67 in file t/pod/poderrs.t
+*** ERROR: Nested =begin's (first at line 71:html) at line 73 in file t/pod/poderrs.t
+*** ERROR: =end without =begin at line 77 in file t/pod/poderrs.t
+*** ERROR: No argument for =begin at line 83 in file t/pod/poderrs.t
+*** ERROR: =for without formatter specification at line 89 in file t/pod/poderrs.t
+*** ERROR: nested commands C<...C<...>...> at line 95 in file t/pod/poderrs.t
+*** ERROR: garbled entity E<alea iacta est> at line 99 in file t/pod/poderrs.t
+*** ERROR: garbled entity E<C<auml>> at line 100 in file t/pod/poderrs.t
+*** ERROR: garbled entity E<abcI<bla>> at line 101 in file t/pod/poderrs.t
+*** ERROR: Entity number out of range E<0x100> at line 102 in file t/pod/poderrs.t
+*** ERROR: Entity number out of range E<07777> at line 103 in file t/pod/poderrs.t
+*** ERROR: Entity number out of range E<300> at line 104 in file t/pod/poderrs.t
+*** ERROR: malformed link L<> : empty link at line 116 in file t/pod/poderrs.t
+*** WARNING: ignoring leading whitespace in link at line 117 in file t/pod/poderrs.t
+*** WARNING: ignoring trailing whitespace in link at line 118 in file t/pod/poderrs.t
+*** WARNING: (section) in 'passwd(5)' deprecated at line 124 in file t/pod/poderrs.t
+*** WARNING: node '$|' contains non-escaped | or / at line 125 in file t/pod/poderrs.t
+*** WARNING: alternative text '$|' contains non-escaped | or / at line 125 in file t/pod/poderrs.t
+*** ERROR: Spurious character(s) after =back at line 131 in file t/pod/poderrs.t
+*** ERROR: Nonempty Z<> at line 145 in file t/pod/poderrs.t
+*** ERROR: Empty X<> at line 147 in file t/pod/poderrs.t
+*** WARNING: preceding non-item paragraph(s) at line 153 in file t/pod/poderrs.t
+*** WARNING: No argument for =item at line 155 in file t/pod/poderrs.t
+*** WARNING: previous =item has no contents at line 157 in file t/pod/poderrs.t
+*** WARNING: No items in =over (at line 165) / =back list at line 167 in file t/pod/poderrs.t
+*** ERROR: Spurious text after =pod at line 173 in file t/pod/poderrs.t
+*** ERROR: Spurious text after =cut at line 177 in file t/pod/poderrs.t
+*** WARNING: empty section in previous paragraph at line 193 in file t/pod/poderrs.t
+*** ERROR: unresolved internal link 'begin or begin' at line 108 in file t/pod/poderrs.t
+*** ERROR: unresolved internal link 'end with begin' at line 109 in file t/pod/poderrs.t
+*** ERROR: unresolved internal link 'OoPs' at line 110 in file t/pod/poderrs.t
+*** ERROR: unresolved internal link 'abc def' at line 114 in file t/pod/poderrs.t
+*** ERROR: unresolved internal link 'I/O Operators' at line 202 in file t/pod/poderrs.t
*** WARNING: multiple occurrence of link target 'Misc' at line - in file t/pod/poderrs.t
-t/pod/poderrs.t has 33 pod syntax errors.
+t/pod/poderrs.t has 34 pod syntax errors.
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
-man Print the manual page and exit.
-section *section-spec*
- Specify a section to include in the output. See "SECTION
- SPECIFICATIONS" in Pod::Select for the format to use for
- *section-spec*. This option may be given multiple times on the
- command line.
+ Specify a section to include in the output. See the section on
+ "SECTION SPECIFICATIONS" in the Pod::Parser manpage for the
+ format to use for *section-spec*. This option may be given
+ multiple times on the command line.
*file* The pathname of a file from which to select sections of pod
documentation (defaults to standard input).
are given than all pod sections encountered are output.
podselect invokes the podselect() function exported by Pod::Select
- Please see "podselect()" in Pod::Select for more details.
+ Please see the podselect() entry in the Pod::Select manpage for more
+ details.
SEE ALSO
- Pod::Parser and Pod::Select
+ the Pod::Parser manpage and the Pod::Select manpage
AUTHOR
Brad Appleton <bradapp@enteract.com>
BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib';
- unshift @INC, './pod';
+ use File::Basename;
+ my $THISDIR = dirname $0;
+ unshift @INC, $THISDIR;
require "testp2pt.pl";
import TestPodIncPlainText;
}
- This is a test to see if I can do not only $self and `method()', but
+ This is a test to see if I can do not only `$self' and `method()', but
also `$self->method()' and `$self->{FIELDNAME}' and `$Foo <=> $Bar'
without resorting to escape sequences. If I want to refer to the
right-shift operator I can do something like `$x >> 3' or even `$y >>
Dont forget `$self->method()->{FIELDNAME} = {FOO=>BAR}'.
- And make sure that 0 works too!
+ And make sure that `0' works too!
Now, if I use << or >> as my delimiters, then I have to use whitespace.
So things like `<$self-'method()>> and `<$self-'{FIELDNAME}>> wont end
$MYPKG = eval { (caller)[0] };
@EXPORT = qw(&testpodplaintext);
BEGIN {
- if ( $] >= 5.005_58 ) {
- require Pod::Text;
- @ISA = qw( Pod::Text );
- }
- else {
- require Pod::PlainText;
- @ISA = qw( Pod::PlainText );
- }
+ require Pod::PlainText;
+ @ISA = qw( Pod::PlainText );
require VMS::Filespec if $^O eq 'VMS';
}
sub catfile(@) { File::Spec->catfile(@_); }
my $INSTDIR = abs_path(dirname $0);
-if ($^O eq 'VMS') { # clean up directory spec
- $INSTDIR = VMS::Filespec::unixpath($INSTDIR);
- $INSTDIR =~ s#/$##;
- $INSTDIR =~ s#/000000/#/#;
-}
-
-if ($^O eq 'VMS') {
- # File::Spec::VMS::splitdir doesn't work on Unix syntax filespecs, but
- # on VMS syntax filespecs dirname returns (as documented) the directory
- # part of the path (NOT the parent directory, as is assumed in this script).
- $INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 'pod');
- $INSTDIR = (dirname $INSTDIR) if (basename($INSTDIR) eq 't');
-}
-else {
- $INSTDIR = (dirname $INSTDIR) if ((File::Spec->splitdir($INSTDIR))[-1] eq 'pod');
- $INSTDIR = (dirname $INSTDIR) if ((File::Spec->splitdir($INSTDIR))[-1] eq 't');
-}
-
+$INSTDIR = VMS::Filespec::unixpath($INSTDIR) if $^O eq 'VMS';
+$INSTDIR =~ s#/$## if $^O eq 'VMS';
+$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')
);
-print "PODINCDIRS = ",join(', ',@PODINCDIRS),"\n";
## Find the path to the file to =include
sub findinclude {
sub podinc2plaintext( $ $ ) {
my ($infile, $outfile) = @_;
local $_;
- my $text_parser = $MYPKG->new(quotes => "`'");
+ my $text_parser = $MYPKG->new;
$text_parser->parse_from_file($infile, $outfile);
}
for $podfile (@testpods) {
($testname, $_) = fileparse($podfile);
$testdir ||= $_;
- $testname =~ s/\..*$//;
+ $testname =~ s/\.t$//;
$cmpfile = $testdir . $testname . '.xr';
$outfile = $testdir . $testname . '.OUT';