summaryrefslogtreecommitdiff
path: root/cpan/Pod-Simple
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2015-06-13 20:45:09 +0100
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2015-06-13 20:45:09 +0100
commit08d70c44c994325f220993a1a8ad668f3f27da0c (patch)
tree5b9026e17ebd86defec998a2e7344b44178003a6 /cpan/Pod-Simple
parent12144562d1d1c6240a4960ddc56fc6c407ed88b6 (diff)
downloadperl-08d70c44c994325f220993a1a8ad668f3f27da0c.tar.gz
Update Pod-Simple to CPAN version 3.30
[DELTA] 2015-02-23 David E. Wheeler <david@justatheory.org> * Release 3.30 No changes since 3.29_6. 2015-02-19 David E. Wheeler <david@justatheory.org> * Release 3.29_6 The survey() method in Pod::Simple::Search now ignores duplicat files with varying lettercasing on case-insensitive file systems. This allows When pondering files in a given directory, the survey() method in Pod::Simple::Search now prefers files with extensions in the following order: no extension, .pod, .pm, .plx, .pl. The find() method in Pod::Simple::Search now records the './pod' subdirectory of each directory it considers in such a way as to preserve its case on the file system. The find() method in Pod::Simple::Search now tries harder to find the proper file on case-insensitive file systems when searching for modules starting with "Pod". For example, when searching for 'Pod::Perldoc' it now returns a file ending in 'Pod/Perldoc.pm' instead of 'Pod/perldoc.pod', as the latter is actually the documention for the 'perldoc' program. 2015-02-17 David E. Wheeler <david@justatheory.org> * Release 3.29_5 No changes except that the release tarball should no longer be empty. 2015-02-16 David E. Wheeler <david@justatheory.org> * Release 3.29_4 Removed "Caveats" from the docs. Pod::Simple has been out of beta for years. The survey() method in Pod::Simple::Search no longer assumes that files ending in '.pod' are actually Pod. Like .pm and .pl files, .pod files must contains at least one valid POD command, as documented. This brings the behavior in line with find(), which already required that .pod files contain Pod. The survey() method in Pod::Simple::Search now prefers files ending in .pod over those ending in .pm, and .pm over those ending in .pl, when it finds duplicate pod files for a given name. 2015-02-11 David E. Wheeler <david@justatheory.org> * Release 3.29_3 Tightened up the first pass at recognizing a Pod command so that fewer invalid Pod lines will be recognized. Suggested by Randy Stauner. Fixed bug where Pod::Simple would attempt to call utf8::unicode_to_native on Perl 5.6, where that function does not exist. Typos and minor wordsmithing changes in Pod::Simple::Subclassing, thanks to Randy Stauner. The Pod::Simple::Search survey() and find() methods now use the same code for determining @INC directories to search. The only difference is that find() also includes $Config::Config{'scriptdir'}.
Diffstat (limited to 'cpan/Pod-Simple')
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple.pm80
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple.pod12
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm120
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Checker.pm12
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Debug.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm10
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/HTML.pm36
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm4
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Methody.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Progress.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm8
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/RTF.pm53
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Search.pm131
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod18
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Text.pm12
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm8
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm61
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm2
-rw-r--r--cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm10
-rw-r--r--cpan/Pod-Simple/t/ascii_order.pl26
-rw-r--r--cpan/Pod-Simple/t/basic.t6
-rw-r--r--cpan/Pod-Simple/t/corpus.t6
-rw-r--r--cpan/Pod-Simple/t/corpus/encwarn01.xml2
-rw-r--r--cpan/Pod-Simple/t/corpus/lat1frim.xml2
-rw-r--r--cpan/Pod-Simple/t/encod04.t148
-rw-r--r--cpan/Pod-Simple/t/search10.t20
-rw-r--r--cpan/Pod-Simple/t/search12.t19
-rw-r--r--cpan/Pod-Simple/t/search20.t19
-rw-r--r--cpan/Pod-Simple/t/search22.t19
-rw-r--r--cpan/Pod-Simple/t/search26.t15
-rw-r--r--cpan/Pod-Simple/t/search28.t13
-rw-r--r--cpan/Pod-Simple/t/search50.t16
-rw-r--r--cpan/Pod-Simple/t/xhtml01.t2
43 files changed, 612 insertions, 304 deletions
diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pm b/cpan/Pod-Simple/lib/Pod/Simple.pm
index 538969d9fb..b9a1197810 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple.pm
@@ -18,7 +18,7 @@ use vars qw(
);
@ISA = ('Pod::Simple::BlackBox');
-$VERSION = '3.29';
+$VERSION = '3.30';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
@@ -48,6 +48,22 @@ if(DEBUG > 2) {
print "# We are under a Unicode-safe Perl.\n";
}
+# The NO BREAK SPACE and SOFT HYHPEN are used in several submodules.
+if ($] ge 5.007_003) { # On sufficiently modern Perls we can handle any
+ # character set
+ $Pod::Simple::nbsp = chr utf8::unicode_to_native(0xA0);
+ $Pod::Simple::shy = chr utf8::unicode_to_native(0xAD);
+}
+elsif (Pod::Simple::ASCII) { # Hard code ASCII early Perl
+ $Pod::Simple::nbsp = "\xA0";
+ $Pod::Simple::shy = "\xAD";
+}
+else { # EBCDIC on early Perl. We know what the values are for the code
+ # pages supported then.
+ $Pod::Simple::nbsp = "\x41";
+ $Pod::Simple::shy = "\xCA";
+}
+
# Design note:
# This is a parser for Pod. It is not a parser for the set of Pod-like
# languages which happens to contain Pod -- it is just for Pod, plus possibly
@@ -317,6 +333,13 @@ sub unaccept_targets {
#
# And now codes (not targets or directives)
+# XXX Probably it is an error that the digit '9' is excluded from these re's.
+# Broken for early Perls on EBCDIC
+my $xml_name_re = eval "qr/[^-.0-8:A-Z_a-z[:^ascii:]]/";
+if (! defined $xml_name_re) {
+ $xml_name_re = qr/[\x00-\x2C\x2F\x39\x3B-\x40\x5B-\x5E\x60\x7B-\x7F]/;
+}
+
sub accept_code { shift->accept_codes(@_) } # alias
sub accept_codes { # Add some codes
@@ -324,20 +347,17 @@ sub accept_codes { # Add some codes
foreach my $new_code (@_) {
next unless defined $new_code and length $new_code;
- if(ASCII) {
- # A good-enough check that it's good as an XML Name symbol:
- Carp::croak "\"$new_code\" isn't a valid element name"
- if $new_code =~
- m/[\x00-\x2C\x2F\x39\x3B-\x40\x5B-\x5E\x60\x7B-\x7F]/
- # Characters under 0x80 that aren't legal in an XML Name.
- or $new_code =~ m/^[-\.0-9]/s
- or $new_code =~ m/:[-\.0-9]/s;
- # The legal under-0x80 Name characters that
- # an XML Name still can't start with.
- }
-
+ # A good-enough check that it's good as an XML Name symbol:
+ Carp::croak "\"$new_code\" isn't a valid element name"
+ if $new_code =~ $xml_name_re
+ # Characters under 0x80 that aren't legal in an XML Name.
+ or $new_code =~ m/^[-\.0-9]/s
+ or $new_code =~ m/:[-\.0-9]/s;
+ # The legal under-0x80 Name characters that
+ # an XML Name still can't start with.
+
$this->{'accept_codes'}{$new_code} = $new_code;
-
+
# Yes, map to itself -- just so that when we
# see "=extend W [whatever] thatelementname", we say that W maps
# to whatever $this->{accept_codes}{thatelementname} is,
@@ -359,18 +379,15 @@ sub unaccept_codes { # remove some codes
foreach my $new_code (@_) {
next unless defined $new_code and length $new_code;
- if(ASCII) {
- # A good-enough check that it's good as an XML Name symbol:
- Carp::croak "\"$new_code\" isn't a valid element name"
- if $new_code =~
- m/[\x00-\x2C\x2F\x39\x3B-\x40\x5B-\x5E\x60\x7B-\x7F]/
- # Characters under 0x80 that aren't legal in an XML Name.
- or $new_code =~ m/^[-\.0-9]/s
- or $new_code =~ m/:[-\.0-9]/s;
- # The legal under-0x80 Name characters that
- # an XML Name still can't start with.
- }
-
+ # A good-enough check that it's good as an XML Name symbol:
+ Carp::croak "\"$new_code\" isn't a valid element name"
+ if $new_code =~ $xml_name_re
+ # Characters under 0x80 that aren't legal in an XML Name.
+ or $new_code =~ m/^[-\.0-9]/s
+ or $new_code =~ m/:[-\.0-9]/s;
+ # The legal under-0x80 Name characters that
+ # an XML Name still can't start with.
+
Carp::croak "But you must accept \"$new_code\" codes -- it's a builtin!"
if grep $new_code eq $_, @Known_formatting_codes;
@@ -1441,15 +1458,6 @@ sub _treat_Ss {
return;
}
-# We can get NO BREAK SPACE accurately for any platform for recent Perls; for
-# earlier ones use the ASCII value for those platforms, and assume the typical
-# EBCDIC value for any others.
-my $nbsp = ($] >= 5.007003)
- ? chr utf8::unicode_to_native(0xA0)
- : (ASCII)
- ? "\xA0"
- : "\x41";
-
sub _change_S_to_nbsp { # a recursive function
# Sanely assumes that the top node in the excursion won't be an S node.
my($treelet, $in_s) = @_;
@@ -1467,7 +1475,7 @@ sub _change_S_to_nbsp { # a recursive function
$i += @$to_pull_up - 1; # Make $i skip the pulled-up stuff
}
} else {
- $treelet->[$i] =~ s/\s/$nbsp/g if $in_s;
+ $treelet->[$i] =~ s/\s/$Pod::Simple::nbsp/g if $in_s;
# Note that if you apply nbsp_for_S to text, and so turn
# "foo S<bar baz> quux" into "foo bar&#160;faz quux", you
diff --git a/cpan/Pod-Simple/lib/Pod/Simple.pod b/cpan/Pod-Simple/lib/Pod/Simple.pod
index aadba19e94..60229bdce6 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple.pod
+++ b/cpan/Pod-Simple/lib/Pod/Simple.pod
@@ -349,21 +349,15 @@ octets into Perl's internal character string representation using the value of
the C<=encoding> declaration in the POD source.
If the POD source does not include an C<=encoding> declaration, the parser will
-attempt to guess the encoding (selecting one of UTF-8 or Latin-1) by examining
+attempt to guess the encoding (selecting one of UTF-8 or CP 1252) by examining
the first non-ASCII bytes and applying the heuristic described in
-L<perlpodspec>.
+L<perlpodspec>. (It the POD source contains only ASCII bytes, the
+encoding is assumed to be ASCII.)
If you set the C<parse_characters> option to a true value the parser will
expect characters rather than octets; will ignore any C<=encoding>; and will
make no attempt to decode the input.
-=head1 CAVEATS
-
-This is just a beta release -- there are a good number of things still
-left to do. Notably, support for EBCDIC platforms is still half-done,
-an untested.
-
-
=head1 SEE ALSO
L<Pod::Simple::Subclassing>
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
index ee6e747a6a..5c1461fe3d 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
@@ -22,13 +22,27 @@ use integer; # vroom!
use strict;
use Carp ();
use vars qw($VERSION );
-$VERSION = '3.29';
+$VERSION = '3.30';
#use constant DEBUG => 7;
BEGIN {
require Pod::Simple;
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG
}
+# Matches a character iff the character will have a different meaning
+# if we choose CP1252 vs UTF-8 if there is no =encoding line.
+# This is broken for early Perls on non-ASCII platforms.
+my $non_ascii_re = eval "qr/[[:^ascii:]]/";
+$non_ascii_re = qr/[\x80-\xFF]/ if ! defined $non_ascii_re;
+
+my $utf8_bom;
+if (($] ge 5.007_003)) {
+ $utf8_bom = "\x{FEFF}";
+ utf8::encode($utf8_bom);
+} else {
+ $utf8_bom = "\xEF\xBB\xBF"; # No EBCDIC BOM detection for early Perls.
+}
+
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
sub parse_line { shift->parse_lines(@_) } # alias
@@ -87,7 +101,7 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines)
} else {
DEBUG > 2 and print "First line: [$source_line]\n";
- if( ($line = $source_line) =~ s/^\xEF\xBB\xBF//s ) {
+ if( ($line = $source_line) =~ s/^$utf8_bom//s ) {
DEBUG and print "UTF-8 BOM seen. Faking a '=encoding utf8'.\n";
$self->_handle_encoding_line( "=encoding utf8" );
delete $self->{'_processed_encoding'};
@@ -123,28 +137,102 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines)
}
}
- # Try to guess encoding. Inlined for performance reasons.
if(!$self->{'parse_characters'} && !$self->{'encoding'}
&& ($self->{'in_pod'} || $line =~ /^=/s)
- && $line =~ /[[:^ascii:]]/
+ && $line =~ /$non_ascii_re/
) {
+
my $encoding;
- if (ord("A") != 65) {
- # Hard to figure out on non-ASCII platform if UTF-8 or not. This
- # won't work if it isn't UTF-8, so just assume it is and hope for the
- # best. It's not clear that the other encodings work on non-ASCII
- # platforms anyway.
- $encoding = 'UTF-8';
- }
- else {
- $encoding = $line =~ /^[\x00-\x7f]*[\xC0-\xFD][\x80-\xBF]/ ? 'UTF-8' : 'ISO8859-1';
- }
+ # No =encoding line, and we are at the first line in the input that
+ # contains a non-ascii byte, that is one whose meaning varies depending
+ # on whether the file is encoded in UTF-8 or CP1252, which are the two
+ # possibilities permitted by the pod spec. (ASCII is assumed if the
+ # file only contains ASCII bytes.) In order to process this line, we
+ # need to figure out what encoding we will use for the file.
+ #
+ # Strictly speaking ISO 8859-1 (Latin 1) refers to the code points
+ # 160-255, but it is used here, as it often colloquially is, to refer to
+ # the complete set of code points 0-255, including ASCII (0-127), the C1
+ # controls (128-159), and strict Latin 1 (160-255).
+ #
+ # CP1252 is effectively a superset of Latin 1, because it differs only
+ # from colloquial 8859-1 in the C1 controls, which are very unlikely to
+ # actually be present in 8859-1 files, so can be used for other purposes
+ # without conflict. CP 1252 uses most of them for graphic characters.
+ #
+ # Note that all ASCII-range bytes represent their corresponding code
+ # points in CP1252 and UTF-8. In ASCII platform UTF-8 all other code
+ # points require multiple (non-ASCII) bytes to represent. (A separate
+ # paragraph for EBCDIC is below.) The multi-byte representation is
+ # quite structured. If we find an isolated byte that requires multiple
+ # bytes to represent in UTF-8, we know that the encoding is not UTF-8.
+ # If we find a sequence of bytes that violates the UTF-8 structure, we
+ # also can presume the encoding isn't UTF-8, and hence must be 1252.
+ #
+ # But there are ambiguous cases where we could guess wrong. If so, the
+ # user will end up having to supply an =encoding line. We use all
+ # readily available information to improve our chances of guessing
+ # right. The odds of something not being UTF-8, but still passing a
+ # UTF-8 validity test go down very rapidly with increasing length of the
+ # sequence. Therefore we look at all the maximal length non-ascii
+ # sequences on the line. If any of the sequences can't be UTF-8, we
+ # quit there and choose CP1252. If all could be UTF-8, we guess UTF-8.
+ #
+ # On EBCDIC platforms, the situation is somewhat different. In
+ # UTF-EBCDIC, not only do ASCII-range bytes represent their code points,
+ # but so do the bytes that are for the C1 controls. Recall that these
+ # correspond to the unused portion of 8859-1 that 1252 mostly takes
+ # over. That means that there are fewer code points that are
+ # represented by multi-bytes. But, note that the these controls are
+ # very unlikely to be in pod text. So if we encounter one of them, it
+ # means that it is quite likely CP1252 and not UTF-8. The net result is
+ # the same code below is used for both platforms.
+ while ($line =~ m/($non_ascii_re+)/g) {
+ my $non_ascii_seq = $1;
+
+ if (length $non_ascii_seq == 1) {
+ $encoding = 'CP1252';
+ goto guessed;
+ } elsif ($] ge 5.007_003) {
+
+ # On Perls that have this function, we can see if the sequence is
+ # valid UTF-8 or not.
+ if (! utf8::decode($non_ascii_seq)) {
+ $encoding = 'CP1252';
+ goto guessed;
+ }
+ } elsif (ord("A") == 65) { # An early Perl, ASCII platform
+
+ # Without utf8::decode, it's a lot harder to do a rigorous check
+ # (though some early releases had a different function that
+ # accomplished the same thing). Since these are ancient Perls, not
+ # likely to be in use today, we take the easy way out, and look at
+ # just the first two bytes of the sequence to see if they are the
+ # start of a UTF-8 character. In ASCII UTF-8, continuation bytes
+ # must be between 0x80 and 0xBF. Start bytes can range from 0xC2
+ # through 0xFF, but anything above 0xF4 is not Unicode, and hence
+ # extremely unlikely to be in a pod.
+ if ($non_ascii_seq !~ /^[\xC2-\xF4][\x80-\xBF]/) {
+ $encoding = 'CP1252';
+ goto guessed;
+ }
+
+ # We don't bother doing anything special for EBCDIC on early Perls.
+ # If there is a solitary variant, CP1252 will be chosen; otherwise
+ # UTF-8.
+ }
+ } # End of loop through all variant sequences on the line
+
+ # All sequences in the line could be UTF-8. Guess that.
+ $encoding = 'UTF-8';
+
+ guessed:
$self->_handle_encoding_line( "=encoding $encoding" );
delete $self->{'_processed_encoding'};
$self->{'_transcoder'} && $self->{'_transcoder'}->($line);
- my ($word) = $line =~ /(\S*[[:^ascii:]]\S*)/;
+ my ($word) = $line =~ /(\S*$non_ascii_re\S*)/;
$self->whine(
$self->{'line_count'},
@@ -155,7 +243,7 @@ sub parse_lines { # Usage: $parser->parse_lines(@lines)
DEBUG > 5 and print "# Parsing line: [$line]\n";
if(!$self->{'in_pod'}) {
- if($line =~ m/^=([a-zA-Z]+)/s) {
+ if($line =~ m/^=([a-zA-Z][a-zA-Z0-9]*)(?:\s|$)/s) {
if($1 eq 'cut') {
$self->scream(
$self->{'line_count'},
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm b/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm
index 3ef64eea65..7f7390bf23 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/Checker.pm
@@ -9,7 +9,7 @@ use Carp ();
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
-$VERSION = '3.29';
+$VERSION = '3.30';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
@@ -91,9 +91,9 @@ sub emit_par {
my $indent = ' ' x ( 2 * $self->{'Indent'} + ($tweak_indent||0) );
# Yes, 'STRING' x NEGATIVE gives '', same as 'STRING' x 0
- $self->{'Thispara'} =~ tr{\xAD}{}d if Pod::Simple::ASCII;
+ $self->{'Thispara'} =~ s/$Pod::Simple::shy//g;
my $out = Text::Wrap::wrap($indent, $indent, $self->{'Thispara'} .= "\n");
- $out =~ tr{\xA0}{ } if Pod::Simple::ASCII;
+ $out =~ s/$Pod::Simple::nbsp/ /g;
print {$self->{'output_fh'}} $out,
#"\n"
;
@@ -107,10 +107,8 @@ sub emit_par {
sub end_Verbatim {
return unless $_[0]{'Errata_seen'};
my $self = shift;
- if(Pod::Simple::ASCII) {
- $self->{'Thispara'} =~ tr{\xA0}{ };
- $self->{'Thispara'} =~ tr{\xAD}{}d;
- }
+ $self->{'Thispara'} =~ s/$Pod::Simple::nbsp/ /g;
+ $self->{'Thispara'} =~ s/$Pod::Simple::shy//g;
my $i = ' ' x ( 2 * $self->{'Indent'} + 4);
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm b/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm
index 2bbd50a664..c27170d9c6 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/Debug.pm
@@ -2,7 +2,7 @@ require 5;
package Pod::Simple::Debug;
use strict;
use vars qw($VERSION );
-$VERSION = '3.29';
+$VERSION = '3.30';
sub import {
my($value,$variable);
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm
index dfde4d66b2..03be00b068 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsText.pm
@@ -1,7 +1,7 @@
require 5;
package Pod::Simple::DumpAsText;
-$VERSION = '3.29';
+$VERSION = '3.30';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
index 4db6a06149..560275dd1d 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/DumpAsXML.pm
@@ -1,7 +1,7 @@
require 5;
package Pod::Simple::DumpAsXML;
-$VERSION = '3.29';
+$VERSION = '3.30';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
@@ -70,11 +70,13 @@ sub _handle_element_end {
sub _xml_escape {
foreach my $x (@_) {
# Escape things very cautiously:
- $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg;
+ if ($] ge 5.007_003) {
+ $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(utf8::native_to_unicode(ord($1))).';'/eg;
+ } else { # Is broken for non-ASCII platforms on early perls
+ $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg;
+ }
# Yes, stipulate the list without a range, so that this can work right on
# all charsets that this module happens to run under.
- # Altho, hmm, what about that ord? Presumably that won't work right
- # under non-ASCII charsets. Something should be done about that.
}
return;
}
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm
index 2c6494b9ba..d46290d85a 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/HTML.pm
@@ -9,7 +9,7 @@ use vars qw(
$Doctype_decl $Content_decl
);
@ISA = ('Pod::Simple::PullParser');
-$VERSION = '3.29';
+$VERSION = '3.30';
BEGIN {
if(defined &DEBUG) { } # no-op
elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG }
@@ -654,7 +654,7 @@ sub do_pod_link {
$self->resolve_pod_page_link($to, $section);
# (I pass it the section value, but I don't see a
# particular reason it'd use it.)
- DEBUG > 1 and print "resolve_pod_page_link gives ", $to || "(nil)", "\n";
+ DEBUG > 1 and print "resolve_pod_page_link gives ", $there || "(nil)", "\n";
unless( defined $there and length $there ) {
DEBUG and print "Can't resolve $to\n";
return undef;
@@ -695,7 +695,11 @@ sub section_name_tidy {
$section =~ s/^\s+//;
$section =~ s/\s+$//;
$section =~ tr/ /_/;
- $section =~ tr/\x00-\x1F\x80-\x9F//d if 'A' eq chr(65); # drop crazy characters
+ if ($] ge 5.006) {
+ $section =~ s/[[:cntrl:][:^ascii:]]//g; # drop crazy characters
+ } elsif ('A' eq chr(65)) { # But not on early EBCDIC
+ $section =~ tr/\x00-\x1F\x80-\x9F//d;
+ }
$section = $self->unicode_escape_url($section);
$section = '_' unless length $section;
return $section;
@@ -714,12 +718,13 @@ sub general_url_escape {
# A pretty conservative escaping, behoovey even for query components
# of a URL (see RFC 2396)
- $string =~ s/([^-_\.!~*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/sprintf('%%%02X',ord($1))/eg;
+ if ($] ge 5.007_003) {
+ $string =~ s/([^-_\.!~*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/sprintf('%%%02X',utf8::native_to_unicode(ord($1)))/eg;
+ } else { # Is broken for non-ASCII platforms on early perls
+ $string =~ s/([^-_\.!~*()abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/sprintf('%%%02X',ord($1))/eg;
+ }
# Yes, stipulate the list without a range, so that this can work right on
# all charsets that this module happens to run under.
- # Altho, hmm, what about that ord? Presumably that won't work right
- # under non-ASCII charsets. Something should be done
- # about that, I guess?
return $string;
}
@@ -851,21 +856,28 @@ sub esc { # a function.
@_ = splice @_; # break aliasing
} else {
my $x = shift;
- $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg;
+ if ($] ge 5.007_003) {
+ $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(utf8::native_to_unicode(ord($1))).';'/eg;
+ } else { # Is broken for non-ASCII platforms on early perls
+ $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg;
+ }
return $x;
}
}
foreach my $x (@_) {
# Escape things very cautiously:
- $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg
- if defined $x;
+ if (defined $x) {
+ if ($] ge 5.007_003) {
+ $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(utf8::native_to_unicode(ord($1))).';'/eg
+ } else { # Is broken for non-ASCII platforms on early perls
+ $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg
+ }
+ }
# Leave out "- so that "--" won't make it thru in X-generated comments
# with text in them.
# Yes, stipulate the list without a range, so that this can work right on
# all charsets that this module happens to run under.
- # Altho, hmm, what about that ord? Presumably that won't work right
- # under non-ASCII charsets. Something should be done about that.
}
return @_;
}
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm
index 19e700b825..85cad7b359 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/HTMLBatch.pm
@@ -5,7 +5,7 @@ use strict;
use vars qw( $VERSION $HTML_RENDER_CLASS $HTML_EXTENSION
$CSS $JAVASCRIPT $SLEEPY $SEARCH_CLASS @ISA
);
-$VERSION = '3.29';
+$VERSION = '3.30';
@ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML!
# TODO: nocontents stylesheets. Strike some of the color variations?
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm b/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm
index 2139509303..34582e1f3e 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/LinkSection.pm
@@ -3,12 +3,12 @@ require 5;
package Pod::Simple::LinkSection;
# Based somewhat dimly on Array::Autojoin
use vars qw($VERSION );
-$VERSION = '3.29';
+$VERSION = '3.30';
use strict;
use Pod::Simple::BlackBox;
use vars qw($VERSION );
-$VERSION = '3.29';
+$VERSION = '3.30';
use overload( # So it'll stringify nice
'""' => \&Pod::Simple::BlackBox::stringify_lol,
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm b/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm
index d867b1ce93..cb2707689e 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/Methody.pm
@@ -4,7 +4,7 @@ package Pod::Simple::Methody;
use strict;
use Pod::Simple ();
use vars qw(@ISA $VERSION);
-$VERSION = '3.29';
+$VERSION = '3.30';
@ISA = ('Pod::Simple');
# Yes, we could use named variables, but I want this to be impose
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm b/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm
index 3a87b99842..968f0a4cdf 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/Progress.pm
@@ -1,7 +1,7 @@
require 5;
package Pod::Simple::Progress;
-$VERSION = '3.29';
+$VERSION = '3.30';
use strict;
# Objects of this class are used for noting progress of an
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm
index 0e47ec3413..7af5d12480 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParser.pm
@@ -1,6 +1,6 @@
require 5;
package Pod::Simple::PullParser;
-$VERSION = '3.29';
+$VERSION = '3.30';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm
index bb5ac7adbf..f8747a88fe 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserEndToken.pm
@@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken ();
use strict;
use vars qw(@ISA $VERSION);
@ISA = ('Pod::Simple::PullParserToken');
-$VERSION = '3.29';
+$VERSION = '3.30';
sub new { # Class->new(tagname);
my $class = shift;
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm
index dbb0b2c859..bec0e2e228 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserStartToken.pm
@@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken ();
use strict;
use vars qw(@ISA $VERSION);
@ISA = ('Pod::Simple::PullParserToken');
-$VERSION = '3.29';
+$VERSION = '3.30';
sub new { # Class->new(tagname, optional_attrhash);
my $class = shift;
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm
index 9db7f1ee8f..59fd06ddcc 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserTextToken.pm
@@ -5,7 +5,7 @@ use Pod::Simple::PullParserToken ();
use strict;
use vars qw(@ISA $VERSION);
@ISA = ('Pod::Simple::PullParserToken');
-$VERSION = '3.29';
+$VERSION = '3.30';
sub new { # Class->new(text);
my $class = shift;
@@ -70,6 +70,12 @@ Or, if you want to alter the value, you can even do things like this:
}
...or however you want to alter the value...
+ (Note that starting with Perl v5.8, you can use, e.g.,
+
+ my $nbsp = chr utf8::unicode_to_native(0xA0);
+ s/$nbsp/ /g;
+
+ to handle the above regardless if it's an ASCII world or not)
}
=back
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm b/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm
index 46ab1fd4d3..4beff5cc6b 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/PullParserToken.pm
@@ -3,7 +3,7 @@ require 5;
package Pod::Simple::PullParserToken;
# Base class for tokens gotten from Pod::Simple::PullParser's $parser->get_token
@ISA = ();
-$VERSION = '3.29';
+$VERSION = '3.30';
use strict;
sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm b/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm
index 617190418b..5c72ababb6 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/RTF.pm
@@ -8,7 +8,7 @@ package Pod::Simple::RTF;
use strict;
use vars qw($VERSION @ISA %Escape $WRAP %Tagmap);
-$VERSION = '3.29';
+$VERSION = '3.30';
use Pod::Simple::PullParser ();
BEGIN {@ISA = ('Pod::Simple::PullParser')}
@@ -17,6 +17,16 @@ BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG }
$WRAP = 1 unless defined $WRAP;
+# These are broken for early Perls on EBCDIC; they could be fixed to work
+# better there, but not worth it. These are part of a larger [...] class, so
+# are just the strings to substitute into it, as opposed to compiled patterns.
+my $cntrl = '[:cntrl:]';
+$cntrl = '\x00-\x1F\x7F' unless eval "qr/[$cntrl]/";
+
+my $not_ascii = '[:^ascii:]';
+$not_ascii = '\x80-\xFF' unless eval "qr/[$not_ascii]/";
+
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub _openclose {
@@ -176,7 +186,7 @@ sub do_middle { # the main work
s/(?:
^
|
- (?<=[\cm\cj\t "\[\<\(])
+ (?<=[\r\n\t "\[\<\(])
) # start on whitespace, sequence-start, or quote
( # something looking like a Perl token:
(?:
@@ -185,7 +195,7 @@ sub do_middle { # the main work
|
# or starting alpha, but containing anything strange:
(?:
- [a-zA-Z'\x80-\xFF]+[\$\@\:_<>\(\\\*]\S+
+ [a-zA-Z'${not_ascii}]+[\$\@\:_<>\(\\\*]\S+
)
)
/\cb$1\cc/xsg
@@ -194,10 +204,10 @@ sub do_middle { # the main work
rtf_esc($scratch);
$scratch =~
s/(
- [^\cm\cj\n]{65} # Snare 65 characters from a line
- [^\cm\cj\n\x20]{0,50} # and finish any current word
+ [^\r\n]{65} # Snare 65 characters from a line
+ [^\r\n ]{0,50} # and finish any current word
)
- (\x20{1,10})(?![\cm\cj\n]) # capture some spaces not at line-end
+ (\ {1,10})(?![\r\n]) # capture some spaces not at line-end
/$1$2\n/gx # and put a NL before those spaces
if $WRAP;
# This may wrap at well past the 65th column, but not past the 120th.
@@ -300,7 +310,7 @@ sub do_middle { # the main work
if ($tagname eq 'item-number') {
print $fh $token->attr('number'), ". \n";
} elsif ($tagname eq 'item-bullet') {
- print $fh "\\'95 \n";
+ print $fh "\\'", ord("_"), "\n";
#for funky testing: print $fh '', rtf_esc("\x{4E4B}\x{9053}");
}
@@ -483,19 +493,19 @@ sub rtf_esc {
my $x; # scratch
if(!defined wantarray) { # void context: alter in-place!
for(@_) {
- s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER
+ s/([F${cntrl}\-\\\{\}${not_ascii}])/$Escape{$1}/g; # ESCAPER
s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
}
return;
} elsif(wantarray) { # return an array
return map {; ($x = $_) =~
- s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER
+ s/([F${cntrl}\-\\\{\}${not_ascii}])/$Escape{$1}/g; # ESCAPER
$x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
$x;
} @_;
} else { # return a single scalar
($x = ((@_ == 1) ? $_[0] : join '', @_)
- ) =~ s/([F\x00-\x1F\-\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER
+ ) =~ s/([F${cntrl}\-\\\{\}${not_ascii}])/$Escape{$1}/g; # ESCAPER
# Escape \, {, }, -, control chars, and 7f-ff.
$x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
return $x;
@@ -512,19 +522,19 @@ sub rtf_esc_codely {
my $x; # scratch
if(!defined wantarray) { # void context: alter in-place!
for(@_) {
- s/([F\x00-\x1F\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER
+ s/([F${cntrl}\\\{\}${not_ascii}])/$Escape{$1}/g; # ESCAPER
s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
}
return;
} elsif(wantarray) { # return an array
return map {; ($x = $_) =~
- s/([F\x00-\x1F\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER
+ s/([F${cntrl}\\\{\}${not_ascii}])/$Escape{$1}/g; # ESCAPER
$x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
$x;
} @_;
} else { # return a single scalar
($x = ((@_ == 1) ? $_[0] : join '', @_)
- ) =~ s/([F\x00-\x1F\\\{\}\x7F-\xFF])/$Escape{$1}/g; # ESCAPER
+ ) =~ s/([F${cntrl}\\\{\}${not_ascii}])/$Escape{$1}/g; # ESCAPER
# Escape \, {, }, -, control chars, and 7f-ff.
$x =~ s/([^\x00-\xFF])/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg;
return $x;
@@ -532,25 +542,30 @@ sub rtf_esc_codely {
}
%Escape = (
- map( (chr($_),chr($_)), # things not apparently needing escaping
+ (($] lt 5.007_003) # Broken for non-ASCII on early Perls
+ ? (map( (chr($_),chr($_)), # things not apparently needing escaping
+ 0x20 .. 0x7E ),
+ map( (chr($_),sprintf("\\'%02x", $_)), # apparently escapeworthy things
+ 0x00 .. 0x1F, 0x5c, 0x7b, 0x7d, 0x7f .. 0xFF, 0x46))
+ : (map( (chr(utf8::unicode_to_native($_)),chr(utf8::unicode_to_native($_))),
0x20 .. 0x7E ),
- map( (chr($_),sprintf("\\'%02x", $_)), # apparently escapeworthy things
- 0x00 .. 0x1F, 0x5c, 0x7b, 0x7d, 0x7f .. 0xFF, 0x46),
+ map( (chr($_),sprintf("\\'%02x", utf8::unicode_to_native($_))),
+ 0x00 .. 0x1F, 0x5c, 0x7b, 0x7d, 0x7f .. 0xFF, 0x46))),
# We get to escape out 'F' so that we can send RTF files thru the mail
# without the slightest worry that paragraphs beginning with "From"
# will get munged.
# And some refinements:
- "\cm" => "\n",
+ "\r" => "\n",
"\cj" => "\n",
"\n" => "\n\\line ",
"\t" => "\\tab ", # Tabs (altho theoretically raw \t's are okay)
"\f" => "\n\\page\n", # Formfeed
"-" => "\\_", # Turn plaintext '-' into a non-breaking hyphen
- "\xA0" => "\\~", # Latin-1 non-breaking space
- "\xAD" => "\\-", # Latin-1 soft (optional) hyphen
+ $Pod::Simple::nbsp => "\\~", # Latin-1 non-breaking space
+ $Pod::Simple::shy => "\\-", # Latin-1 soft (optional) hyphen
# CRAZY HACKS:
"\n" => "\\line\n",
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Search.pm b/cpan/Pod-Simple/lib/Pod/Simple/Search.pm
index 49df34d354..5be5aea732 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Search.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/Search.pm
@@ -3,7 +3,7 @@ package Pod::Simple::Search;
use strict;
use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY);
-$VERSION = '3.29'; ## Current version of this package
+$VERSION = '3.30'; ## Current version of this package
BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level
use Carp ();
@@ -17,7 +17,7 @@ $MAX_VERSION_WITHIN ||= 60;
#use diagnostics;
use File::Spec ();
-use File::Basename qw( basename );
+use File::Basename qw( basename dirname );
use Config ();
use Cwd qw( cwd );
@@ -25,6 +25,7 @@ use Cwd qw( cwd );
__PACKAGE__->_accessorize( # Make my dumb accessor methods
'callback', 'progress', 'dir_prefix', 'inc', 'laborious', 'limit_glob',
'limit_re', 'shadows', 'verbose', 'name2path', 'path2name', 'recurse',
+ 'ciseen'
);
#==========================================================================
@@ -51,11 +52,11 @@ sub survey {
$self->_expand_inc( \@search_dirs );
-
$self->{'_scan_count'} = 0;
$self->{'_dirs_visited'} = {};
$self->path2name( {} );
$self->name2path( {} );
+ $self->ciseen( {} );
$self->limit_re( $self->_limit_glob_to_limit_re ) if $self->{'limit_glob'};
my $cwd = cwd();
my $verbose = $self->verbose;
@@ -115,12 +116,25 @@ sub survey {
}
$self->progress and $self->progress->done(
"Noted $$self{'_scan_count'} Pod files total");
+ $self->ciseen( {} );
return unless defined wantarray; # void
return $self->name2path unless wantarray; # scalar
return $self->name2path, $self->path2name; # list
}
+my $IS_CASE_INSENSITIVE;
+sub _is_case_insensitive {
+ unless (defined $IS_CASE_INSENSITIVE) {
+ $IS_CASE_INSENSITIVE = 0;
+ my ($uc) = glob uc __FILE__;
+ if ($uc) {
+ my ($lc) = glob lc __FILE__;
+ $IS_CASE_INSENSITIVE = 1 if $lc;
+ }
+ }
+ return $IS_CASE_INSENSITIVE;
+}
#==========================================================================
sub _make_search_callback {
@@ -128,10 +142,20 @@ sub _make_search_callback {
# Put the options in variables, for easy access
my( $laborious, $verbose, $shadows, $limit_re, $callback, $progress,
- $path2name, $name2path, $recurse) =
+ $path2name, $name2path, $recurse, $ciseen) =
map scalar($self->$_()),
qw(laborious verbose shadows limit_re callback progress
- path2name name2path recurse);
+ path2name name2path recurse ciseen);
+ my ($seen, $remember, $files_for);
+ if (_is_case_insensitive) {
+ $seen = sub { $ciseen->{ lc $_[0] } };
+ $remember = sub { $name2path->{ $_[0] } = $ciseen->{ lc $_[0] } = $_[1]; };
+ $files_for = sub { my $n = lc $_[0]; grep { lc $path2name->{$_} eq $n } %{ $path2name } };
+ } else {
+ $seen = sub { $name2path->{ $_[0] } };
+ $remember = sub { $name2path->{ $_[0] } = $_[1] };
+ $files_for = sub { my $n = $_[0]; grep { $path2name->{$_} eq $n } %{ $path2name } };
+ }
my($file, $shortname, $isdir, $modname_bits);
return sub {
@@ -171,7 +195,6 @@ sub _make_search_callback {
return; # (not pruning);
}
-
# Make sure it's a file even worth even considering
if($laborious) {
unless(
@@ -197,31 +220,26 @@ sub _make_search_callback {
return;
}
- if( !$shadows and $name2path->{$name} ) {
+ if( !$shadows and $seen->($name) ) {
$verbose and print "Not worth considering $file ",
"-- already saw $name as ",
- join(' ', grep($path2name->{$_} eq $name, keys %$path2name)), "\n";
+ join(' ', $files_for->($name)), "\n";
return;
}
-
+
# Put off until as late as possible the expense of
# actually reading the file:
- if( m/\.pod\z/is ) {
- # just assume it has pod, okay?
- } else {
- $progress and $progress->reach($self->{'_scan_count'}, "Scanning $file");
- return unless $self->contains_pod( $file );
- }
+ $progress and $progress->reach($self->{'_scan_count'}, "Scanning $file");
+ return unless $self->contains_pod( $file );
++ $self->{'_scan_count'};
# Or finally take note of it:
- if( $name2path->{$name} ) {
+ if ( my $prev = $seen->($name) ) {
$verbose and print
"Duplicate POD found (shadowing?): $name ($file)\n",
- " Already seen in ",
- join(' ', grep($path2name->{$_} eq $name, keys %$path2name)), "\n";
+ " Already seen in ", join(' ', $files_for->($name)), "\n";
} else {
- $name2path->{$name} = $file; # Noting just the first occurrence
+ $remember->($name, $file); # Noting just the first occurrence
}
$verbose and print " Noting $name = $file\n";
if( $callback ) {
@@ -326,7 +344,14 @@ sub _recurse_dir {
closedir(INDIR);
return
}
- my @items = sort readdir(INDIR);
+
+ # Load all items; put no extension before .pod before .pm before .plx?.
+ my @items = map { $_->[0] }
+ sort { $a->[1] cmp $b->[1] || $b->[2] cmp $a->[2] }
+ map {
+ (my $t = $_) =~ s/[.]p(m|lx?|od)\z//;
+ [$_, $t, lc($1 || 'z') ]
+ } readdir(INDIR);
closedir(INDIR);
push @$modname_bits, $dir_bare unless $dir_bare eq '';
@@ -528,6 +553,14 @@ sub _limit_glob_to_limit_re {
# contribution mostly from Tim Jenness <t.jenness@jach.hawaii.edu>
+sub _actual_filenames {
+ my $dir = shift;
+ my $fn = lc shift;
+ opendir my $dh, $dir or return;
+ return map { File::Spec->catdir($dir, $_) }
+ grep { lc $_ eq $fn } readdir $dh;
+}
+
sub find {
my($self, $pod, @search_dirs) = @_;
$self = $self->new unless ref $self; # tolerate being a class method
@@ -544,34 +577,17 @@ sub find {
#@search_dirs = File::Spec->curdir unless @search_dirs;
- if( $self->inc ) {
- if( $^O eq 'MacOS' ) {
- push @search_dirs, $self->_mac_whammy(@INC);
- } else {
- push @search_dirs, @INC;
- }
-
- # Add location of pod documentation for perl man pages (eg perlfunc)
- # This is a pod directory in the private install tree
- #my $perlpoddir = File::Spec->catdir($Config::Config{'installprivlib'},
- # 'pod');
- #push (@search_dirs, $perlpoddir)
- # if -d $perlpoddir;
-
- # Add location of binaries such as pod2text:
- push @search_dirs, $Config::Config{'scriptdir'};
- # and if that's undef or q{} or nonexistent, we just ignore it later
- }
+ $self->_expand_inc(\@search_dirs);
+ # Add location of binaries such as pod2text:
+ push @search_dirs, $Config::Config{'scriptdir'} if $self->inc;
my %seen_dir;
- Dir:
- foreach my $dir ( @search_dirs ) {
+ while (my $dir = shift @search_dirs ) {
next unless defined $dir and length $dir;
next if $seen_dir{$dir};
$seen_dir{$dir} = 1;
unless(-d $dir) {
print "Directory $dir does not exist\n" if $verbose;
- next Dir;
}
print "Looking in directory $dir\n" if $verbose;
@@ -580,16 +596,36 @@ sub find {
foreach my $ext ('', '.pod', '.pm', '.pl') { # possible extensions
my $fullext = $fullname . $ext;
- if( -f $fullext and $self->contains_pod( $fullext ) ){
+ if ( -f $fullext and $self->contains_pod($fullext) ) {
print "FOUND: $fullext\n" if $verbose;
+ if (@parts > 1 && lc $parts[0] eq 'pod' && _is_case_insensitive && $ext eq '.pod') {
+ # Well, this file could be for a program (perldoc) but we actually
+ # want a module (Pod::Perldoc). So see if there is a .pm with the
+ # proper casing.
+ my $subdir = dirname $fullext;
+ unless (grep { $fullext eq $_ } _actual_filenames $subdir, "$parts[-1].pod") {
+ print "# Looking for alternate spelling in $subdir\n" if $verbose;
+ # Try the .pm file.
+ my $pm = $fullname . '.pm';
+ if ( -f $pm and $self->contains_pod($pm) ) {
+ # Prefer the .pm if its case matches.
+ if (grep { $pm eq $_ } _actual_filenames $subdir, "$parts[-1].pm") {
+ print "FOUND: $fullext\n" if $verbose;
+ return $pm;
+ }
+ }
+ }
+ }
return $fullext;
}
}
- my $subdir = File::Spec->catdir($dir,'pod');
- if(-d $subdir) { # slip in the ./pod dir too
- $verbose and print "Noticing $subdir and stopping there...\n";
- $dir = $subdir;
- redo Dir;
+
+ # Case-insensitively Look for ./pod directories and slip them in.
+ for my $subdir ( _actual_filenames($dir, 'pod') ) {
+ if (-d $subdir) {
+ $verbose and print "Noticing $subdir and looking there...\n";
+ unshift @search_dirs, $subdir;
+ }
}
}
@@ -1005,6 +1041,7 @@ with default attribute values is used.
Returns true if the supplied filename (not POD module) contains some Pod
documentation.
+
=head1 SUPPORT
Questions or discussion about POD and Pod::Simple should be sent to the
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm b/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm
index 201e37aac9..14199df0c3 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/SimpleTree.pm
@@ -5,7 +5,7 @@ use strict;
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '3.29';
+$VERSION = '3.30';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod b/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod
index e3f09a34e1..9768ace3f5 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod
+++ b/cpan/Pod-Simple/lib/Pod/Simple/Subclassing.pod
@@ -46,7 +46,7 @@ anyone has a formatter for that format -- maybe someone cobbled one
together but just hasn't released it.
B<The first step> in writing a Pod processor is to read L<perlpodspec>,
-which contains notes information on writing a Pod parser (which has been
+which contains information on writing a Pod parser (which has been
largely taken care of by Pod::Simple), but also a lot of requirements
and recommendations for writing a formatter.
@@ -78,7 +78,7 @@ like L<HTML::TokeParser>'s interface.
L<Pod::Simple::SimpleTree> provides a simple tree interface, rather like
L<XML::Parser>'s "Tree" interface. Users familiar with XML handling will
-be comfortable with this interface. Users interested in outputting XML,
+be comfortable with this interface. Users interested in outputting XML,
should look into the modules that produce an XML representation of the
Pod stream, notably L<Pod::Simple::XMLOutStream>; you can feed the output
of such a class to whatever XML parsing system you are most at home with.
@@ -87,8 +87,8 @@ of such a class to whatever XML parsing system you are most at home with.
B<The last step> is to write your code based on how the events (or tokens,
or tree-nodes, or the XML, or however you're parsing) will map to
-constructs in the output format. Also sure to consider how to escape
-text nodes containing arbitrary text, and also what to do with text
+constructs in the output format. Also be sure to consider how to escape
+text nodes containing arbitrary text, and what to do with text
nodes that represent preformatted text (from verbatim sections).
@@ -272,7 +272,7 @@ produces this event structure:
crontab(5)
</L>
-In the rare cases where a man page link has a specified, that text appears
+In the rare cases where a man page link has a section specified, that text appears
in a I<section> attribute. For example, this Pod source:
L<crontab(5)/"ENVIRONMENT">
@@ -461,7 +461,7 @@ will produce this event structure:
et al.
</head1>
-"=head2" thru "=head4" directives are the same, except for the element
+"=head2" through "=head4" directives are the same, except for the element
names in the event structure.
=item events with an element_name of encoding
@@ -922,8 +922,8 @@ interesting, but this is included for completeness.
=item C<< $parser->whine( I<linenumber>, I<complaint string> ) >>
-This notes a problem in the Pod, which will be reported to in the "Pod
-Errors" section of the document and/or send to STDERR, depending on the
+This notes a problem in the Pod, which will be reported in the "Pod
+Errors" section of the document and/or sent to STDERR, depending on the
values of the attributes C<no_whining>, C<no_errata_section>, and
C<complain_stderr>.
@@ -1021,7 +1021,7 @@ indented text, showing each event on its own line
L<Pod::Simple::LinkSection> -- class for objects representing the values
of the TODO and TODO attributes of LE<lt>...E<gt> elements
-L<Pod::Escapes> -- the module the Pod::Simple uses for evaluating
+L<Pod::Escapes> -- the module that Pod::Simple uses for evaluating
EE<lt>...E<gt> content
L<Pod::Simple::Text> -- a simple plaintext formatter for Pod
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Text.pm b/cpan/Pod-Simple/lib/Pod/Simple/Text.pm
index b3292f8c49..2a417c2e71 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Text.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/Text.pm
@@ -6,7 +6,7 @@ use Carp ();
use Pod::Simple::Methody ();
use Pod::Simple ();
use vars qw( @ISA $VERSION $FREAKYMODE);
-$VERSION = '3.29';
+$VERSION = '3.30';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
@@ -81,9 +81,9 @@ sub emit_par {
my $indent = ' ' x ( 2 * $self->{'Indent'} + 4 + ($tweak_indent||0) );
# Yes, 'STRING' x NEGATIVE gives '', same as 'STRING' x 0
- $self->{'Thispara'} =~ tr{\xAD}{}d if Pod::Simple::ASCII;
+ $self->{'Thispara'} =~ s/$Pod::Simple::shy//g;
my $out = Text::Wrap::wrap($indent, $indent, $self->{'Thispara'} .= "\n");
- $out =~ tr{\xA0}{ } if Pod::Simple::ASCII;
+ $out =~ s/$Pod::Simple::nbsp/ /g;
print {$self->{'output_fh'}} $out, "\n";
$self->{'Thispara'} = '';
@@ -94,10 +94,8 @@ sub emit_par {
sub end_Verbatim {
my $self = shift;
- if(Pod::Simple::ASCII) {
- $self->{'Thispara'} =~ tr{\xA0}{ };
- $self->{'Thispara'} =~ tr{\xAD}{}d;
- }
+ $self->{'Thispara'} =~ s/$Pod::Simple::nbsp/ /g;
+ $self->{'Thispara'} =~ s/$Pod::Simple::shy//g;
my $i = ' ' x ( 2 * $self->{'Indent'} + 4);
#my $i = ' ' x (4 + $self->{'Indent'});
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm b/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm
index 516f28cb22..33c34f8a26 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/TextContent.pm
@@ -6,7 +6,7 @@ use strict;
use Carp ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
-$VERSION = '3.29';
+$VERSION = '3.30';
@ISA = ('Pod::Simple');
sub new {
@@ -25,10 +25,8 @@ sub _handle_element_start {
}
sub _handle_text {
- if( chr(65) eq 'A' ) { # in ASCIIworld
- $_[1] =~ tr/\xAD//d;
- $_[1] =~ tr/\xA0/ /;
- }
+ $_[1] =~ s/$Pod::Simple::shy//g;
+ $_[1] =~ s/$Pod::Simple::nbsp/ /g;
print {$_[0]{'output_fh'}} $_[1];
return;
}
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm b/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm
index dbf5210388..925408be68 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/TiedOutFH.pm
@@ -4,7 +4,7 @@ package Pod::Simple::TiedOutFH;
use Symbol ('gensym');
use Carp ();
use vars qw($VERSION );
-$VERSION = '3.29';
+$VERSION = '3.30';
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm b/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm
index 9c60f05d02..0dee9cb7b3 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/Transcode.pm
@@ -2,7 +2,7 @@
require 5;
package Pod::Simple::Transcode;
use vars qw($VERSION );
-$VERSION = '3.29';
+$VERSION = '3.30';
BEGIN {
if(defined &DEBUG) {;} # Okay
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm
index badb9a0d43..53082d7081 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeDumb.pm
@@ -5,7 +5,7 @@ require 5;
package Pod::Simple::TranscodeDumb;
use strict;
use vars qw($VERSION %Supported);
-$VERSION = '3.29';
+$VERSION = '3.30';
# This module basically pretends it knows how to transcode, except
# only for null-transcodings! We use this when Encode isn't
# available.
@@ -14,6 +14,7 @@ $VERSION = '3.29';
'ascii' => 1,
'ascii-ctrl' => 1,
'iso-8859-1' => 1,
+ 'cp1252' => 1,
'null' => 1,
'latin1' => 1,
'latin-1' => 1,
@@ -36,24 +37,46 @@ sub encmodver {
}
sub make_transcoder {
- my($e) = $_[1];
- die "WHAT ENCODING!?!?" unless $e;
- my $x;
- return sub {;
- #foreach $x (@_) {
- # if(Pod::Simple::ASCII and !Pod::Simple::UNICODE and $] > 5.005) {
- # # We're in horrible gimp territory, so we need to knock out
- # # all the highbit things
- # $x =
- # pack 'C*',
- # map {; ($_ < 128) ? $_ : 0x7e }
- # unpack "C*",
- # $x
- # ;
- # }
- #}
- #
- #return;
+ my ($e) = $_[1];
+ die "WHAT ENCODING!?!?" unless $e;
+ # No-op for all but CP1252.
+ return sub {;} if $e !~ /^cp-?1252$/i;
+
+ # Replace CP1252 nerbles with their ASCII equivalents.
+ return sub {
+ # Copied from Encode::ZapCP1252.
+ my %ascii_for = (
+ # http://en.wikipedia.org/wiki/Windows-1252
+ "\x80" => 'e', # EURO SIGN
+ "\x82" => ',', # SINGLE LOW-9 QUOTATION MARK
+ "\x83" => 'f', # LATIN SMALL LETTER F WITH HOOK
+ "\x84" => ',,', # DOUBLE LOW-9 QUOTATION MARK
+ "\x85" => '...', # HORIZONTAL ELLIPSIS
+ "\x86" => '+', # DAGGER
+ "\x87" => '++', # DOUBLE DAGGER
+ "\x88" => '^', # MODIFIER LETTER CIRCUMFLEX ACCENT
+ "\x89" => '%', # PER MILLE SIGN
+ "\x8a" => 'S', # LATIN CAPITAL LETTER S WITH CARON
+ "\x8b" => '<', # SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+ "\x8c" => 'OE', # LATIN CAPITAL LIGATURE OE
+ "\x8e" => 'Z', # LATIN CAPITAL LETTER Z WITH CARON
+ "\x91" => "'", # LEFT SINGLE QUOTATION MARK
+ "\x92" => "'", # RIGHT SINGLE QUOTATION MARK
+ "\x93" => '"', # LEFT DOUBLE QUOTATION MARK
+ "\x94" => '"', # RIGHT DOUBLE QUOTATION MARK
+ "\x95" => '*', # BULLET
+ "\x96" => '-', # EN DASH
+ "\x97" => '--', # EM DASH
+ "\x98" => '~', # SMALL TILDE
+ "\x99" => '(tm)', # TRADE MARK SIGN
+ "\x9a" => 's', # LATIN SMALL LETTER S WITH CARON
+ "\x9b" => '>', # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+ "\x9c" => 'oe', # LATIN SMALL LIGATURE OE
+ "\x9e" => 'z', # LATIN SMALL LETTER Z WITH CARON
+ "\x9f" => 'Y', # LATIN CAPITAL LETTER Y WITH DIAERESIS
+ );
+
+ s{([\x80-\x9f])}{$ascii_for{$1} || $1}emxsg for @_;
};
}
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm
index 6735b9979b..0aec8d9004 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/TranscodeSmart.pm
@@ -9,7 +9,7 @@ use strict;
use Pod::Simple;
require Encode;
use vars qw($VERSION );
-$VERSION = '3.29';
+$VERSION = '3.30';
sub is_dumb {0}
sub is_smart {1}
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm b/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm
index 3a2d2094c6..af7e98910c 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/XHTML.pm
@@ -45,7 +45,7 @@ declare the output character set as UTF-8 before parsing, like so:
package Pod::Simple::XHTML;
use strict;
use vars qw( $VERSION @ISA $HAS_HTML_ENTITIES );
-$VERSION = '3.29';
+$VERSION = '3.30';
use Pod::Simple::Methody ();
@ISA = ('Pod::Simple::Methody');
diff --git a/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm b/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm
index a0f50a20fb..6cc1fe6814 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/XMLOutStream.pm
@@ -5,7 +5,7 @@ use strict;
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '3.29';
+$VERSION = '3.30';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
@@ -76,11 +76,13 @@ sub _handle_element_end {
sub _xml_escape {
foreach my $x (@_) {
# Escape things very cautiously:
- $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg;
+ if ($] ge 5.007_003) {
+ $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(utf8::native_to_unicode(ord($1))).';'/eg;
+ } else { # Is broken for non-ASCII platforms on early perls
+ $x =~ s/([^-\n\t !\#\$\%\(\)\*\+,\.\~\/\:\;=\?\@\[\\\]\^_\`\{\|\}abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])/'&#'.(ord($1)).';'/eg;
+ }
# Yes, stipulate the list without a range, so that this can work right on
# all charsets that this module happens to run under.
- # Altho, hmm, what about that ord? Presumably that won't work right
- # under non-ASCII charsets. Something should be done about that.
}
return;
}
diff --git a/cpan/Pod-Simple/t/ascii_order.pl b/cpan/Pod-Simple/t/ascii_order.pl
new file mode 100644
index 0000000000..3b453f12be
--- /dev/null
+++ b/cpan/Pod-Simple/t/ascii_order.pl
@@ -0,0 +1,26 @@
+# Helper for some of the .t's in this directory
+
+sub native_to_uni($) { # Convert from platform character set to Unicode
+ # (which is the same as ASCII)
+ my $string = shift;
+
+ return $string if ord("A") == 65
+ || $] lt 5.007_003; # Doesn't work on early EBCDIC Perls
+ my $output = "";
+ for my $i (0 .. length($string) - 1) {
+ $output .= chr(utf8::native_to_unicode(ord(substr($string, $i, 1))));
+ }
+ # Preserve utf8ness of input onto the output, even if it didn't need to be
+ # utf8
+ utf8::upgrade($output) if utf8::is_utf8($string);
+
+ return $output;
+}
+
+
+sub ascii_order { # Sort helper. Causes the order to be the same as ASCII
+ # no matter what the platform's character set is.
+ return native_to_uni($a) cmp native_to_uni($b);
+}
+
+1
diff --git a/cpan/Pod-Simple/t/basic.t b/cpan/Pod-Simple/t/basic.t
index 0b9cefd361..157a640c9c 100644
--- a/cpan/Pod-Simple/t/basic.t
+++ b/cpan/Pod-Simple/t/basic.t
@@ -7,7 +7,7 @@ BEGIN {
use strict;
use Test;
-BEGIN { plan tests => 30 };
+BEGIN { plan tests => 31 };
#use Pod::Simple::Debug (6);
@@ -87,6 +87,10 @@ ok( Pod::Simple::XMLOutStream->_out("=head1 Chacha\n\nFoo\n"),
'<Document><head1>Chacha</head1><Para>Foo</Para></Document>'
);
+# Make sure an obviously invalid Pod tag is invalid.
+ok( Pod::Simple::XMLOutStream->_out("=F\0blah\n\nwhatever\n"),
+ qq{<Document\ncontentless="1"></Document>}
+);
print "# Wrapping up... one for the road...\n";
ok 1;
diff --git a/cpan/Pod-Simple/t/corpus.t b/cpan/Pod-Simple/t/corpus.t
index 2f59302cfb..e3a500e908 100644
--- a/cpan/Pod-Simple/t/corpus.t
+++ b/cpan/Pod-Simple/t/corpus.t
@@ -10,6 +10,10 @@ BEGIN {
print "1..0 # Skip: Encode was not built\n";
exit 0;
}
+ if (ord("A") != 65) {
+ print "1..0 # Skip: Encode not fully working on non-ASCII platforms at this time\n";
+ exit 0;
+ }
}
#use Pod::Simple::Debug (10);
@@ -168,7 +172,7 @@ foreach my $f (@testfiles) {
skip $skippy, 0;
} else {
print "# $outfilename and $xml don't match!\n";
- print STDERR `diff -u $xml $outfilename`;
+ print STDERR `diff $xml $outfilename`;
ok 0;
}
diff --git a/cpan/Pod-Simple/t/corpus/encwarn01.xml b/cpan/Pod-Simple/t/corpus/encwarn01.xml
index d64d56f55b..8fd20650e8 100644
--- a/cpan/Pod-Simple/t/corpus/encwarn01.xml
+++ b/cpan/Pod-Simple/t/corpus/encwarn01.xml
@@ -30,7 +30,7 @@
</item-text>
<Para start_line="-321">
Non-ASCII character seen before =encoding in &#39;caf&#233;&#39;. Assuming
- ISO8859-1
+ CP1252
</Para>
</over-text>
</Document>
diff --git a/cpan/Pod-Simple/t/corpus/lat1frim.xml b/cpan/Pod-Simple/t/corpus/lat1frim.xml
index 8b9191c7e1..4a667c116e 100644
--- a/cpan/Pod-Simple/t/corpus/lat1frim.xml
+++ b/cpan/Pod-Simple/t/corpus/lat1frim.xml
@@ -71,7 +71,7 @@
</item-text>
<Para start_line="-321">
Non-ASCII character seen before =encoding in &#39;s&#233;parant&#39;.
- Assuming ISO8859-1
+ Assuming CP1252
</Para>
</over-text>
</Document>
diff --git a/cpan/Pod-Simple/t/encod04.t b/cpan/Pod-Simple/t/encod04.t
index fe2c314c39..e2b4fcc20f 100644
--- a/cpan/Pod-Simple/t/encod04.t
+++ b/cpan/Pod-Simple/t/encod04.t
@@ -1,13 +1,6 @@
-# The encoding detection heuristic will choose UTF8 or Latin-1. The current
-# implementation will usually treat CP1252 (aka "Win-Latin-1") as Latin-1 but
+# The encoding detection heuristic will choose UTF8 or CP1252. The current
+# implementation will usually treat CP1252 (aka "Win-Latin-1") as CP1252 but
# can be fooled into seeing it as UTF8.
-#
-# Note 1: Neither guess is 'correct' since even if we choose Latin-1, all the
-# smart quote symbols will be rendered as control characters
-#
-# Note 2: the guess is only applied if the source POD omits =encoding, so
-# CP1252 source will render correctly if properly declared
-#
BEGIN {
if($ENV{PERL_CORE}) {
@@ -18,7 +11,16 @@ BEGIN {
use strict;
use Test;
-BEGIN { plan tests => 5 };
+BEGIN {
+ if ($] lt 5.007_003) {
+ plan tests => 5, todo => [4, 5]; # Need utf8::decode() to pass #5
+ # and isn't available in this
+ # release
+ }
+ else {
+ plan tests => 5, todo => [4];
+ }
+}
ok 1;
@@ -26,14 +28,28 @@ use Pod::Simple::DumpAsXML;
use Pod::Simple::XMLOutStream;
-# Initial, isolated, non-ASCII byte triggers Latin-1 guess and later
+# Initial, isolated, non-ASCII byte triggers CP1252 guess and later
# multi-byte sequence is not considered by heuristic.
-my @output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( qq{
+my $x97;
+my $x91;
+my $dash;
+if ($] ge 5.007_003) {
+ $x97 = chr utf8::unicode_to_native(0x97);
+ $x91 = chr utf8::unicode_to_native(0x91);
+ $dash = '&#8212';
+}
+else { # Tests will fail for early EBCDICs
+ $x97 = chr 0x97;
+ $x91 = chr 0x91;
+ $dash = '--';
+}
+
+my @output_lines = split m/[\r\n]+/, Pod::Simple::XMLOutStream->_out( qq{
=head1 NAME
-Em::Dash \x97 \x91CAF\xC9\x92
+Em::Dash $x97 ${x91}CAF\xC9\x92
=cut
@@ -41,8 +57,8 @@ Em::Dash \x97 \x91CAF\xC9\x92
my($guess) = "@output_lines" =~ m{Non-ASCII.*?Assuming ([\w-]+)};
if( $guess ) {
- if( $guess eq 'ISO8859-1' ) {
- if( grep m{Dash (\x97|&#x97;|&#151;)}, @output_lines ) {
+ if( $guess eq 'CP1252' ) {
+ if( grep m{Dash $dash}, @output_lines ) {
ok 1;
} else {
ok 0;
@@ -50,7 +66,7 @@ if( $guess ) {
}
} else {
ok 0;
- print "# parser guessed wrong encoding expected 'ISO8859-1' got '$guess'\n";
+ print "# parser guessed wrong encoding expected 'CP1252' got '$guess'\n";
}
} else {
ok 0;
@@ -58,65 +74,74 @@ if( $guess ) {
}
-# Initial smart-quote character triggers Latin-1 guess as expected
+# Initial smart-quote character triggers CP1252 guess as expected
-@output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( qq{
+@output_lines = split m/[\r\n]+/, Pod::Simple::XMLOutStream->_out( qq{
=head1 NAME
-Smart::Quote - \x91FUT\xC9\x92
+Smart::Quote - ${x91}FUT\xC9\x92
=cut
} );
-($guess) = "@output_lines" =~ m{Non-ASCII.*?Assuming ([\w-]+)};
-if( $guess ) {
- if( $guess eq 'ISO8859-1' ) {
- ok 1;
- } else {
- ok 0;
- print "# parser guessed wrong encoding expected 'ISO8859-1' got '$guess'\n";
- }
-} else {
- ok 0;
- print "# parser failed to detect non-ASCII bytes in input\n";
+if (ord("A") != 65) { # ASCII-platform dependent test skipped on this platform
+ ok (1);
+}
+else {
+ ($guess) = "@output_lines" =~ m{Non-ASCII.*?Assuming ([\w-]+)};
+ if( $guess ) {
+ if( $guess eq 'CP1252' ) {
+ ok 1;
+ } else {
+ ok 0;
+ print "# parser guessed wrong encoding expected 'CP1252' got '$guess'\n";
+ }
+ } else {
+ ok 0;
+ print "# parser failed to detect non-ASCII bytes in input\n";
+ }
}
# Initial accented character followed by 'smart' apostrophe causes heuristic
-# to choose UTF8 (a rather contrived example)
+# to choose UTF8 (a somewhat contrived example)
-@output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( qq{
+@output_lines = split m/[\r\n]+/, Pod::Simple::XMLOutStream->_out( qq{
=head1 NAME
-Smart::Apostrophe::Fail - L\xC9\x92STRANGE
+=head2 JOS\xC9\x92S PLACE
=cut
} );
-($guess) = "@output_lines" =~ m{Non-ASCII.*?Assuming ([\w-]+)};
-if( $guess ) {
- if( $guess eq 'UTF-8' ) {
- ok 1;
- } else {
- ok 0;
- print "# parser guessed wrong encoding expected 'UTF-8' got '$guess'\n";
- }
-} else {
- ok 0;
- print "# parser failed to detect non-ASCII bytes in input\n";
+if (ord("A") != 65) { # ASCII-platform dependent test skipped on this platform
+ ok (1);
+}
+else {
+ ($guess) = "@output_lines" =~ m{Non-ASCII.*?Assuming ([\w-]+)};
+ if( $guess ) {
+ if( $guess eq 'CP1252' ) {
+ ok 1;
+ } else {
+ ok 0;
+ print "# parser guessed wrong encoding expected 'CP1252' got '$guess'\n";
+ }
+ } else {
+ ok 0;
+ print "# parser failed to detect non-ASCII bytes in input\n";
+ }
}
# The previous example used a CP1252 byte sequence that also happened to be a
-# valid UTF8 byte sequence. In this example the heuristic also guesses 'wrong'
-# despite the byte sequence not being valid UTF8 (it's too short). This could
-# arguably be 'fixed' by using a less naive regex.
+# valid UTF8 byte sequence. In this example we use an illegal UTF-8 sequence
+# (it needs a third byte), so must be 1252
-@output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( qq{
+@output_lines = split m/[\r\n]+/, Pod::Simple::XMLOutStream->_out( qq{
=head1 NAME
@@ -126,17 +151,22 @@ Smart::Apostrophe::Fail - L\xE9\x92Strange
} );
-($guess) = "@output_lines" =~ m{Non-ASCII.*?Assuming ([\w-]+)};
-if( $guess ) {
- if( $guess eq 'UTF-8' ) {
- ok 1;
- } else {
- ok 0;
- print "# parser guessed wrong encoding expected 'UTF-8' got '$guess'\n";
- }
-} else {
- ok 0;
- print "# parser failed to detect non-ASCII bytes in input\n";
+if (ord("A") != 65) { # ASCII-platform dependent test skipped on this platform
+ ok (1);
+}
+else {
+ ($guess) = "@output_lines" =~ m{Non-ASCII.*?Assuming ([\w-]+)};
+ if( $guess ) {
+ if( $guess eq 'CP1252' ) {
+ ok 1;
+ } else {
+ ok 0;
+ print "# parser guessed wrong encoding expected 'CP1252' got '$guess'\n";
+ }
+ } else {
+ ok 0;
+ print "# parser failed to detect non-ASCII bytes in input\n";
+ }
}
diff --git a/cpan/Pod-Simple/t/search10.t b/cpan/Pod-Simple/t/search10.t
index 21f8a2d725..0d0a9d4866 100644
--- a/cpan/Pod-Simple/t/search10.t
+++ b/cpan/Pod-Simple/t/search10.t
@@ -66,13 +66,25 @@ $p =~ s/, +/,\n/g;
$p =~ s/^/# /mg;
print $p;
+my $ascii_order;
+if( -e ($ascii_order = source_path('ascii_order.pl'))) {
+ #
+} elsif(-e ($ascii_order = File::Spec->catdir($cwd, 't', 'ascii_order.pl'))) {
+ #
+} else {
+ print STDERR __FILE__, ": ", __LINE__, ": ascii_order='$ascii_order'; curdir=", $cwd, "; ", File::Spec->catdir($cwd, 't', 'ascii_order.pl'), "\n";
+ die "Can't find ascii_order.pl";
+}
+
+require $ascii_order;
+
{
-my $names = join "|", sort values %$where2name;
+my $names = join "|", sort ascii_order values %$where2name;
ok $names, "Blorm|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|squaa|squaa::Glunk|squaa::Vliff|zikzik";
}
{
-my $names = join "|", sort keys %$name2where;
+my $names = join "|", sort ascii_order keys %$name2where;
ok $names, "Blorm|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|squaa|squaa::Glunk|squaa::Vliff|zikzik";
}
@@ -93,12 +105,12 @@ $p =~ s/^/# /mg;
print $p;
{
-my $names = join "|", sort values %$where2name;
+my $names = join "|", sort ascii_order values %$where2name;
ok $names, "Blorm|squaa|zikzik";
}
{
-my $names = join "|", sort keys %$name2where;
+my $names = join "|", sort ascii_order keys %$name2where;
ok $names, "Blorm|squaa|zikzik";
}
diff --git a/cpan/Pod-Simple/t/search12.t b/cpan/Pod-Simple/t/search12.t
index e5bf492d72..851cf28f3c 100644
--- a/cpan/Pod-Simple/t/search12.t
+++ b/cpan/Pod-Simple/t/search12.t
@@ -59,13 +59,24 @@ $p =~ s/, +/,\n/g;
$p =~ s/^/# /mg;
print $p;
+my $ascii_order;
+if( -e ($ascii_order = source_path('ascii_order.pl'))) {
+ #
+} elsif(-e ($ascii_order = File::Spec->catdir($cwd, 't', 'ascii_order.pl'))) {
+ #
+} else {
+ die "Can't find ascii_order.pl";
+}
+
+require $ascii_order;
+
{
-my $names = join "|", sort values %$where2name;
+my $names = join "|", sort ascii_order values %$where2name;
ok $names, "Blorm|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|squaa|squaa::Glunk|squaa::Vliff|zikzik";
}
{
-my $names = join "|", sort keys %$name2where;
+my $names = join "|", sort ascii_order keys %$name2where;
ok $names, "Blorm|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|squaa|squaa::Glunk|squaa::Vliff|zikzik";
}
@@ -87,12 +98,12 @@ $p =~ s/^/# /mg;
print $p;
{
-my $names = lc join "|", sort values %$where2name;
+my $names = lc join "|", sort ascii_order values %$where2name;
ok $names, "suzzle";
}
{
-my $names = lc join "|", sort keys %$name2where;
+my $names = lc join "|", sort ascii_order keys %$name2where;
ok $names, "suzzle";
}
diff --git a/cpan/Pod-Simple/t/search20.t b/cpan/Pod-Simple/t/search20.t
index ea161cc4a8..043a0a7e8a 100644
--- a/cpan/Pod-Simple/t/search20.t
+++ b/cpan/Pod-Simple/t/search20.t
@@ -67,15 +67,26 @@ $p =~ s/, +/,\n/g;
$p =~ s/^/# /mg;
print $p;
+my $ascii_order;
+if( -e ($ascii_order = source_path('ascii_order.pl'))) {
+ #
+} elsif(-e ($ascii_order = File::Spec->catdir($cwd, 't', 'ascii_order.pl'))) {
+ #
+} else {
+ die "Can't find ascii_order.pl";
+}
+
+require $ascii_order;
+
{
-my $names = join "|", sort values %$where2name;
+my $names = join "|", sort ascii_order values %$where2name;
skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
$names,
"Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik";
}
{
-my $names = join "|", sort keys %$name2where;
+my $names = join "|", sort ascii_order keys %$name2where;
skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
$names,
"Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik";
@@ -99,14 +110,14 @@ $p =~ s/^/# /mg;
print $p;
{
-my $names = join "|", sort values %$where2name;
+my $names = join "|", sort ascii_order values %$where2name;
skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
$names,
"Blorm|Suzzle|squaa|zikzik";
}
{
-my $names = join "|", sort keys %$name2where;
+my $names = join "|", sort ascii_order keys %$name2where;
skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
$names,
"Blorm|Suzzle|squaa|zikzik";
diff --git a/cpan/Pod-Simple/t/search22.t b/cpan/Pod-Simple/t/search22.t
index 24a91ed45e..64a6eeb737 100644
--- a/cpan/Pod-Simple/t/search22.t
+++ b/cpan/Pod-Simple/t/search22.t
@@ -68,9 +68,20 @@ $p =~ s/, +/,\n/g;
$p =~ s/^/# /mg;
print $p;
+my $ascii_order;
+if( -e ($ascii_order = source_path('ascii_order.pl'))) {
+ #
+} elsif(-e ($ascii_order = File::Spec->catdir($cwd, 't', 'ascii_order.pl'))) {
+ #
+} else {
+ die "Can't find ascii_order.pl";
+}
+
+require $ascii_order;
+
{
print "# won't show any shadows, since we're just looking at the name2where keys\n";
-my $names = join "|", sort keys %$name2where;
+my $names = join "|", sort ascii_order keys %$name2where;
skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
$names,
"Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Vliff|perlflif|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Wowo|zikzik";
@@ -78,7 +89,7 @@ skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
{
print "# but here we'll see shadowing:\n";
-my $names = join "|", sort values %$where2name;
+my $names = join "|", sort ascii_order values %$where2name;
skip $^O eq 'VMS' ? '-- case may or may not be preserved' : 0,
$names,
"Blorm|Suzzle|Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Glunk|hinkhonk::Vliff|hinkhonk::Vliff|perlflif|perlthng|perlthng|perlzuk|squaa|squaa::Glunk|squaa::Vliff|squaa::Vliff|squaa::Vliff|squaa::Wowo|zikzik";
@@ -87,10 +98,10 @@ my %count;
for(values %$where2name) { ++$count{$_} };
#print pretty(\%count), "\n\n";
delete @count{ grep $count{$_} < 2, keys %count };
-my $shadowed = join "|", sort keys %count;
+my $shadowed = join "|", sort ascii_order keys %count;
ok $shadowed, "hinkhonk::Glunk|hinkhonk::Vliff|perlthng|squaa::Vliff";
-sub thar { print "# Seen $_[0] :\n", map "# {$_}\n", sort grep $where2name->{$_} eq $_[0],keys %$where2name; return; }
+sub thar { print "# Seen $_[0] :\n", map "# {$_}\n", sort ascii_order grep $where2name->{$_} eq $_[0],keys %$where2name; return; }
ok $count{'perlthng'}, 2;
thar 'perlthng';
diff --git a/cpan/Pod-Simple/t/search26.t b/cpan/Pod-Simple/t/search26.t
index fb9d322c76..00b3ea4f73 100644
--- a/cpan/Pod-Simple/t/search26.t
+++ b/cpan/Pod-Simple/t/search26.t
@@ -78,13 +78,24 @@ $p =~ s/, +/,\n/g;
$p =~ s/^/# /mg;
print $p;
+my $ascii_order;
+if( -e ($ascii_order = source_path('ascii_order.pl'))) {
+ #
+} elsif(-e ($ascii_order = File::Spec->catdir($cwd, 't', 'ascii_order.pl'))) {
+ #
+} else {
+ die "Can't find ascii_order.pl";
+}
+
+require $ascii_order;
+
{
-my $names = join "|", sort keys %$name2where;
+my $names = join "|", sort ascii_order keys %$name2where;
ok $names, "Zonk::Pronk|hinkhonk::Glunk|perlzuk|squaa::Glunk|zikzik";
}
{
-my $names = join "|", sort values %$where2name;
+my $names = join "|", sort ascii_order values %$where2name;
ok $names, "Zonk::Pronk|hinkhonk::Glunk|hinkhonk::Glunk|perlzuk|squaa::Glunk|zikzik";
}
diff --git a/cpan/Pod-Simple/t/search28.t b/cpan/Pod-Simple/t/search28.t
index 9301232317..e0ad49766d 100644
--- a/cpan/Pod-Simple/t/search28.t
+++ b/cpan/Pod-Simple/t/search28.t
@@ -72,8 +72,19 @@ $p =~ s/, +/,\n/g;
$p =~ s/^/# /mg;
print $p;
+my $ascii_order;
+if( -e ($ascii_order = source_path('ascii_order.pl'))) {
+ #
+} elsif(-e ($ascii_order = File::Spec->catdir($cwd, 't', 'ascii_order.pl'))) {
+ #
+} else {
+ die "Can't find ascii_order.pl";
+}
+
+require $ascii_order;
+
{
-my $names = join "|", sort values %$where2name;
+my $names = join "|", sort ascii_order values %$where2name;
ok $names, "Zonk::Pronk|perlzuk|zikzik";
}
diff --git a/cpan/Pod-Simple/t/search50.t b/cpan/Pod-Simple/t/search50.t
index 4501400ef2..15bf5c1d70 100644
--- a/cpan/Pod-Simple/t/search50.t
+++ b/cpan/Pod-Simple/t/search50.t
@@ -39,9 +39,9 @@ ok $found;
# print "# Found $found items in $t seconds!\n# See...\n";
-my $p = pretty( $where2name, $name2where )."\n";
-$p =~ s/, +/,\n/g;
-$p =~ s/^/# /mg;
+# my $p = pretty( $where2name, $name2where )."\n";
+# $p =~ s/, +/,\n/g;
+# $p =~ s/^/# /mg;
# print $p;
# print "# OK, making sure strict and strict.pm were in there...\n";
@@ -64,8 +64,7 @@ SKIP: {
# print "# Test again on a module we know is present, in case the
# strict.pm tests were skipped...\n";
-# Grab the first item in $name2where, since it doesn't matter which we
-# use.
+# Search for all files in $name2where.
while (my ($testmod, $testpath) = each %{ $name2where }) {
unless ( $testmod ) {
fail; # no 'thatpath/<name>.pm' means can't test find()
@@ -74,13 +73,10 @@ while (my ($testmod, $testpath) = each %{ $name2where }) {
my @x = ($x->find($testmod)||'(nil)', $testpath);
# print "# Comparing \"$x[0]\" to \"$x[1]\"\n";
for(@x) { s{[/\\]}{/}g; }
- # If it finds a .pod, it's probably correct, as that's where the docs are.
- # Change it to .pm so that it matches.
- $x[0] =~ s{[.]pod$}{.pm} if $x[1] =~ m{[.]pm$};
# print "# => \"$x[0]\" to \"$x[1]\"\n";
is
- lc $x[0],
- lc $x[1],
+ $x[0],
+ $x[1],
" find('$testmod') should match survey's name2where{$testmod}"
;
}
diff --git a/cpan/Pod-Simple/t/xhtml01.t b/cpan/Pod-Simple/t/xhtml01.t
index dba6e5e450..01e6f189b4 100644
--- a/cpan/Pod-Simple/t/xhtml01.t
+++ b/cpan/Pod-Simple/t/xhtml01.t
@@ -708,7 +708,7 @@ This is Anna's "Answer" to the <q>Question</q>.
=cut
EOPOD
-my $T = $use_html_entities ? 84 : 'x54';
+my $T = $use_html_entities ? ord('T') : sprintf ("x%X", ord('T'));
is($results, <<"EOHTML", 'HTML Entities should be only for specified characters');
<p>&#$T;his is Anna's &quot;Answer&quot; to the &lt;q&gt;Question&lt;/q&gt;.</p>