summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Pod
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod')
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Escapes.pm316
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Find.pm6
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Functions.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Html.pm8
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/InputObjects.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/ParseUtils.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Parser.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc.pm142
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/GetOptsOO.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToANSI.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToChecker.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToMan.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToNroff.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToPod.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToRtf.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTerm.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToText.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTk.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Perldoc/ToXml.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Select.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple.pm19
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple.pod6
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm43
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm21
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm14
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm4
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Methody.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm9
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParserStartToken.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParserTextToken.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/PullParserToken.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/RTF.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm13
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod55
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm5
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm2
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/XHTML.pm50
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm15
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Usage.pm44
51 files changed, 466 insertions, 382 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/Escapes.pm b/Master/tlpkg/tlperl/lib/Pod/Escapes.pm
index 52b52724fce..00501db3e88 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Escapes.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Escapes.pm
@@ -17,7 +17,7 @@ use vars qw(
require Exporter;
@ISA = ('Exporter');
-$VERSION = '1.06';
+$VERSION = '1.07';
@EXPORT_OK = qw(
%Code2USASCII
%Name2character
@@ -48,28 +48,15 @@ sub e2char {
$in = hex $1;
} # else it's decimal, or named
- if($NOT_ASCII) {
- # We're in bizarro world of not-ASCII!
- # Cope with US-ASCII codes, use fallbacks for Latin-1, or use FAR_CHAR.
- unless($in =~ m/^\d+$/s) {
- # It's a named character reference. Get its numeric Unicode value.
- $in = $Name2character{$in};
- return undef unless defined $in; # (if there's no such name)
- $in = ord $in; # (All ents must be one character long.)
- # ...So $in holds the char's US-ASCII numeric value, which we'll
- # now go get the local equivalent for.
- }
-
- # It's numeric, whether by origin or by mutation from a known name
- return $Code2USASCII{$in} # so "65" => "A" everywhere
- || $Latin1Code_to_fallback{$in} # Fallback.
- || $FAR_CHAR; # Fall further back
- }
-
- # Normal handling:
if($in =~ m/^\d+$/s) {
if($] < 5.007 and $in > 255) { # can't be trusted with Unicode
return $FAR_CHAR;
+ } elsif ($] >= 5.007003) {
+ return chr(utf8::unicode_to_native($in));
+ } elsif ($NOT_ASCII) {
+ return $Code2USASCII{$in} # so "65" => "A" everywhere
+ || $Latin1Code_to_fallback{$in} # Fallback.
+ || $FAR_CHAR; # Fall further back
} else {
return chr($in);
}
@@ -99,6 +86,133 @@ sub e2charnum {
#--------------------------------------------------------------------------
+%Code2USASCII = (
+# mostly generated by
+# perl -e "printf qq{ \x25 3s, '\x25s',\n}, $_, chr($_) foreach (32 .. 126)"
+ 32, ' ',
+ 33, '!',
+ 34, '"',
+ 35, '#',
+ 36, '$',
+ 37, '%',
+ 38, '&',
+ 39, "'", #!
+ 40, '(',
+ 41, ')',
+ 42, '*',
+ 43, '+',
+ 44, ',',
+ 45, '-',
+ 46, '.',
+ 47, '/',
+ 48, '0',
+ 49, '1',
+ 50, '2',
+ 51, '3',
+ 52, '4',
+ 53, '5',
+ 54, '6',
+ 55, '7',
+ 56, '8',
+ 57, '9',
+ 58, ':',
+ 59, ';',
+ 60, '<',
+ 61, '=',
+ 62, '>',
+ 63, '?',
+ 64, '@',
+ 65, 'A',
+ 66, 'B',
+ 67, 'C',
+ 68, 'D',
+ 69, 'E',
+ 70, 'F',
+ 71, 'G',
+ 72, 'H',
+ 73, 'I',
+ 74, 'J',
+ 75, 'K',
+ 76, 'L',
+ 77, 'M',
+ 78, 'N',
+ 79, 'O',
+ 80, 'P',
+ 81, 'Q',
+ 82, 'R',
+ 83, 'S',
+ 84, 'T',
+ 85, 'U',
+ 86, 'V',
+ 87, 'W',
+ 88, 'X',
+ 89, 'Y',
+ 90, 'Z',
+ 91, '[',
+ 92, "\\", #!
+ 93, ']',
+ 94, '^',
+ 95, '_',
+ 96, '`',
+ 97, 'a',
+ 98, 'b',
+ 99, 'c',
+ 100, 'd',
+ 101, 'e',
+ 102, 'f',
+ 103, 'g',
+ 104, 'h',
+ 105, 'i',
+ 106, 'j',
+ 107, 'k',
+ 108, 'l',
+ 109, 'm',
+ 110, 'n',
+ 111, 'o',
+ 112, 'p',
+ 113, 'q',
+ 114, 'r',
+ 115, 's',
+ 116, 't',
+ 117, 'u',
+ 118, 'v',
+ 119, 'w',
+ 120, 'x',
+ 121, 'y',
+ 122, 'z',
+ 123, '{',
+ 124, '|',
+ 125, '}',
+ 126, '~',
+);
+
+#--------------------------------------------------------------------------
+
+%Latin1Code_to_fallback = ();
+@Latin1Code_to_fallback{0xA0 .. 0xFF} = (
+# Copied from Text/Unidecode/x00.pm:
+
+' ', qq{!}, qq{C/}, 'PS', qq{\$?}, qq{Y=}, qq{|}, 'SS', qq{"}, qq{(c)}, 'a', qq{<<}, qq{!}, "", qq{(r)}, qq{-},
+'deg', qq{+-}, '2', '3', qq{'}, 'u', 'P', qq{*}, qq{,}, '1', 'o', qq{>>}, qq{1/4}, qq{1/2}, qq{3/4}, qq{?},
+'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I',
+'D', 'N', 'O', 'O', 'O', 'O', 'O', 'x', 'O', 'U', 'U', 'U', 'U', 'U', 'Th', 'ss',
+'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i',
+'d', 'n', 'o', 'o', 'o', 'o', 'o', qq{/}, 'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y',
+
+);
+
+{
+ # Now stuff %Latin1Char_to_fallback:
+ %Latin1Char_to_fallback = ();
+ my($k,$v);
+ while( ($k,$v) = each %Latin1Code_to_fallback) {
+ $Latin1Char_to_fallback{chr $k} = $v;
+ #print chr($k), ' => ', $v, "\n";
+ }
+}
+
+#--------------------------------------------------------------------------
+
%Name2character_number = (
# General XML/XHTML:
'lt' => 60,
@@ -380,147 +494,28 @@ sub e2charnum {
if($] < 5.007 and $number > 255) {
$Name2character{$name} = $FAR_CHAR;
# substitute for Unicode characters, for perls
- # that can't reliable handle them
+ # that can't reliably handle them
+ } elsif ($] >= 5.007003) {
+ $Name2character{$name} = chr utf8::unicode_to_native($number);
+ # normal case for more recent Perls where we can translate from Unicode
+ # to the native character set.
+ }
+ elsif (exists $Code2USASCII{$number}) {
+ $Name2character{$name} = $Code2USASCII{$number};
+ # on older Perls, we can use the translations we have hard-coded in this
+ # file, but these don't include the non-ASCII-range characters
+ }
+ elsif ($NOT_ASCII && $number > 127 && $number < 256) {
+ # this range on old non-ASCII-platform perls is wrong
+ if (exists $Latin1Code_to_fallback{$number}) {
+ $Name2character{$name} = $Latin1Code_to_fallback{$number};
+ } else {
+ $Name2character{$name} = $FAR_CHAR;
+ }
} else {
$Name2character{$name} = chr $number;
- # normal case
}
}
- # So they resolve 'right' even in EBCDIC-land
- $Name2character{'lt' } = '<';
- $Name2character{'gt' } = '>';
- $Name2character{'quot'} = '"';
- $Name2character{'amp' } = '&';
- $Name2character{'apos'} = "'";
- $Name2character{'sol' } = '/';
- $Name2character{'verbar'} = '|';
-}
-
-#--------------------------------------------------------------------------
-
-%Code2USASCII = (
-# mostly generated by
-# perl -e "printf qq{ \x25 3s, '\x25s',\n}, $_, chr($_) foreach (32 .. 126)"
- 32, ' ',
- 33, '!',
- 34, '"',
- 35, '#',
- 36, '$',
- 37, '%',
- 38, '&',
- 39, "'", #!
- 40, '(',
- 41, ')',
- 42, '*',
- 43, '+',
- 44, ',',
- 45, '-',
- 46, '.',
- 47, '/',
- 48, '0',
- 49, '1',
- 50, '2',
- 51, '3',
- 52, '4',
- 53, '5',
- 54, '6',
- 55, '7',
- 56, '8',
- 57, '9',
- 58, ':',
- 59, ';',
- 60, '<',
- 61, '=',
- 62, '>',
- 63, '?',
- 64, '@',
- 65, 'A',
- 66, 'B',
- 67, 'C',
- 68, 'D',
- 69, 'E',
- 70, 'F',
- 71, 'G',
- 72, 'H',
- 73, 'I',
- 74, 'J',
- 75, 'K',
- 76, 'L',
- 77, 'M',
- 78, 'N',
- 79, 'O',
- 80, 'P',
- 81, 'Q',
- 82, 'R',
- 83, 'S',
- 84, 'T',
- 85, 'U',
- 86, 'V',
- 87, 'W',
- 88, 'X',
- 89, 'Y',
- 90, 'Z',
- 91, '[',
- 92, "\\", #!
- 93, ']',
- 94, '^',
- 95, '_',
- 96, '`',
- 97, 'a',
- 98, 'b',
- 99, 'c',
- 100, 'd',
- 101, 'e',
- 102, 'f',
- 103, 'g',
- 104, 'h',
- 105, 'i',
- 106, 'j',
- 107, 'k',
- 108, 'l',
- 109, 'm',
- 110, 'n',
- 111, 'o',
- 112, 'p',
- 113, 'q',
- 114, 'r',
- 115, 's',
- 116, 't',
- 117, 'u',
- 118, 'v',
- 119, 'w',
- 120, 'x',
- 121, 'y',
- 122, 'z',
- 123, '{',
- 124, '|',
- 125, '}',
- 126, '~',
-);
-
-#--------------------------------------------------------------------------
-
-%Latin1Code_to_fallback = ();
-@Latin1Code_to_fallback{0xA0 .. 0xFF} = (
-# Copied from Text/Unidecode/x00.pm:
-
-' ', qq{!}, qq{C/}, 'PS', qq{\$?}, qq{Y=}, qq{|}, 'SS', qq{"}, qq{(c)}, 'a', qq{<<}, qq{!}, "", qq{(r)}, qq{-},
-'deg', qq{+-}, '2', '3', qq{'}, 'u', 'P', qq{*}, qq{,}, '1', 'o', qq{>>}, qq{1/4}, qq{1/2}, qq{3/4}, qq{?},
-'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I',
-'D', 'N', 'O', 'O', 'O', 'O', 'O', 'x', 'O', 'U', 'U', 'U', 'U', 'U', 'Th', 'ss',
-'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i',
-'d', 'n', 'o', 'o', 'o', 'o', 'o', qq{/}, 'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y',
-
-);
-
-{
- # Now stuff %Latin1Char_to_fallback:
- %Latin1Char_to_fallback = ();
- my($k,$v);
- while( ($k,$v) = each %Latin1Code_to_fallback) {
- $Latin1Char_to_fallback{chr $k} = $v;
- #print chr($k), ' => ', $v, "\n";
- }
}
#--------------------------------------------------------------------------
@@ -637,7 +632,12 @@ characters (characters 160-255) are unaffected.
Under EBCDIC platforms, C<e2char($n)> may not always be the
same as C<chr(e2charnum($n))>, and ditto for
C<$Name2character{$name}> and
-C<chr($Name2character_number{$name})>.
+C<chr($Name2character_number{$name})>, because the strings are returned as
+native, and the numbers are returned as Unicode.
+However, for Perls starting with v5.8, C<e2char($n)> is the same as
+C<chr(utf8::unicode_to_native(e2charnum($n)))>, and ditto for
+C<$Name2character{$name}> and
+C<chr(utf8::unicode_to_native($Name2character_number{$name}))>.
=head1 SEE ALSO
diff --git a/Master/tlpkg/tlperl/lib/Pod/Find.pm b/Master/tlpkg/tlperl/lib/Pod/Find.pm
index 6149e7940ae..f258f26df68 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Find.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Find.pm
@@ -14,7 +14,7 @@ package Pod::Find;
use strict;
use vars qw($VERSION);
-$VERSION = '1.62'; ## Current version of this package
+$VERSION = '1.63'; ## Current version of this package
require 5.005; ## requires this Perl version or later
use Carp;
@@ -56,7 +56,7 @@ so be sure to specify them in the B<use> statement if you need them:
use Pod::Find qw(pod_find);
From this version on the typical SCM (software configuration management)
-files/directories like RCS, CVS, SCCS, .svn are ignored.
+directories are ignored. These are: RCS, CVS, SCCS, .svn, .hg, .git, .sync
=cut
@@ -226,7 +226,7 @@ sub pod_find
File::Find::find( sub {
my $item = $File::Find::name;
if(-d) {
- if($item =~ m{/(?:RCS|CVS|SCCS|\.svn)$}) {
+ if($item =~ m{/(?:RCS|CVS|SCCS|\.svn|\.hg|\.git|\.sync)$}) {
$File::Find::prune = 1;
return;
}
diff --git a/Master/tlpkg/tlperl/lib/Pod/Functions.pm b/Master/tlpkg/tlperl/lib/Pod/Functions.pm
index 9e09beee929..87b64d178d7 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Functions.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Functions.pm
@@ -54,7 +54,7 @@ L<perlfunc/"Perl Functions by Category"> section.
=cut
-our $VERSION = '1.08';
+our $VERSION = '1.09';
require Exporter;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Html.pm b/Master/tlpkg/tlperl/lib/Pod/Html.pm
index f9f05b358eb..34729a9c241 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Html.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Html.pm
@@ -3,7 +3,7 @@ use strict;
require Exporter;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-$VERSION = 1.21;
+$VERSION = 1.22;
@ISA = qw(Exporter);
@EXPORT = qw(pod2html htmlify);
@EXPORT_OK = qw(anchorify);
@@ -16,11 +16,7 @@ use File::Spec;
use File::Spec::Unix;
use Getopt::Long;
use Pod::Simple::Search;
-BEGIN {
- if($Config{d_setlocale}) {
- require locale; import locale; # make \w work right in non-ASCII lands
- }
-}
+use locale; # make \w work right in non-ASCII lands
=head1 NAME
diff --git a/Master/tlpkg/tlperl/lib/Pod/InputObjects.pm b/Master/tlpkg/tlperl/lib/Pod/InputObjects.pm
index 87ce2478f63..c4d6fc24691 100644
--- a/Master/tlpkg/tlperl/lib/Pod/InputObjects.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/InputObjects.pm
@@ -12,7 +12,7 @@ package Pod::InputObjects;
use strict;
use vars qw($VERSION);
-$VERSION = '1.62'; ## Current version of this package
+$VERSION = '1.63'; ## Current version of this package
require 5.005; ## requires this Perl version or later
#############################################################################
diff --git a/Master/tlpkg/tlperl/lib/Pod/ParseUtils.pm b/Master/tlpkg/tlperl/lib/Pod/ParseUtils.pm
index e1ff2aeb19b..2afd0cd420e 100644
--- a/Master/tlpkg/tlperl/lib/Pod/ParseUtils.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/ParseUtils.pm
@@ -11,7 +11,7 @@ package Pod::ParseUtils;
use strict;
use vars qw($VERSION);
-$VERSION = '1.62'; ## Current version of this package
+$VERSION = '1.63'; ## Current version of this package
require 5.005; ## requires this Perl version or later
=head1 NAME
diff --git a/Master/tlpkg/tlperl/lib/Pod/Parser.pm b/Master/tlpkg/tlperl/lib/Pod/Parser.pm
index f3a861982ba..63edcd2e197 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Parser.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Parser.pm
@@ -12,7 +12,7 @@ use strict;
## These "variables" are used as local "glob aliases" for performance
use vars qw($VERSION @ISA %myData %myOpts @input_stack);
-$VERSION = '1.62'; ## Current version of this package
+$VERSION = '1.63'; ## Current version of this package
require 5.005; ## requires this Perl version or later
#############################################################################
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc.pm
index 6ddd21d95d4..969019d89ad 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc.pm
@@ -12,7 +12,7 @@ use File::Spec::Functions qw(catfile catdir splitdir);
use vars qw($VERSION @Pagers $Bindir $Pod2man
$Temp_Files_Created $Temp_File_Lifetime
);
-$VERSION = '3.23';
+$VERSION = '3.25';
#..........................................................................
@@ -432,6 +432,16 @@ sub init {
# Make sure creat()s are neither too much nor too little
eval { umask(0077) }; # doubtless someone has no mask
+ if ( $] < 5.008 ) {
+ $self->aside("Your old perl doesn't have proper unicode support.");
+ }
+ else {
+ # http://www.perl.com/pub/2012/04/perlunicookbook-decode-argv-as-utf8.html
+ # Decode command line arguments as UTF-8. See RT#98906 for example problem.
+ use Encode qw(decode_utf8);
+ @ARGV = map { decode_utf8($_, 1) } @ARGV;
+ }
+
$self->{'args'} ||= \@ARGV;
$self->{'found'} ||= [];
$self->{'temp_file_list'} ||= [];
@@ -939,7 +949,7 @@ sub maybe_generate_dynamic_pod {
$self->aside("Hm, I found some Pod from that search!\n");
my ($buffd, $buffer) = $self->new_tempfile('pod', 'dyn');
if ( $] >= 5.008 && $self->opt_L ) {
- binmode($buffd, ":utf8");
+ binmode($buffd, ":encoding(UTF-8)");
print $buffd "=encoding utf8\n\n";
}
@@ -1028,6 +1038,33 @@ sub add_translator { # $self->add_translator($lang);
#..........................................................................
+sub open_fh {
+ my ($self, $op, $path) = @_;
+
+ open my $fh, $op, $path or $self->die("Couldn't open $path: $!");
+ return $fh;
+}
+
+sub set_encoding {
+ my ($self, $fh, $encoding) = @_;
+
+ if ( $encoding =~ /utf-?8/i ) {
+ $encoding = ":encoding(UTF-8)";
+ }
+ else {
+ $encoding = ":encoding($encoding)";
+ }
+
+ if ( $] < 5.008 ) {
+ $self->aside("Your old perl doesn't have proper unicode support.");
+ }
+ else {
+ binmode($fh, $encoding);
+ }
+
+ return $fh;
+}
+
sub search_perlvar {
my($self, $found_things, $pod) = @_;
@@ -1040,8 +1077,7 @@ sub search_perlvar {
DEBUG > 2 and print "Search: @$found_things\n";
my $perlvar = shift @$found_things;
- open(PVAR, "<", $perlvar) # "Funk is its own reward"
- or $self->die("Can't open $perlvar: $!");
+ my $fh = $self->open_fh("<", $perlvar);
if ( $opt ne '$0' && $opt =~ /^\$\d+$/ ) { # handle $1, $2, ...
$opt = '$<I<digits>>';
@@ -1053,15 +1089,19 @@ sub search_perlvar {
# Skip introduction
local $_;
- while (<PVAR>) {
+ my $enc;
+ while (<$fh>) {
+ $enc = $1 if /^=encoding\s+(\S+)/;
last if /^=over 8/;
}
+ $fh = $self->set_encoding($fh, $enc) if $enc;
+
# Look for our variable
my $found = 0;
my $inheader = 1;
my $inlist = 0;
- while (<PVAR>) { # "The Mothership Connection is here!"
+ while (<$fh>) {
last if /^=head2 Error Indicators/;
# \b at the end of $` and friends borks things!
if ( m/^=item\s+$search_re\s/ ) {
@@ -1095,7 +1135,7 @@ sub search_perlvar {
if (!@$pod) {
CORE::die( "No documentation for perl variable '$opt' found\n" );
}
- close PVAR or $self->die( "Can't open $perlvar: $!" );
+ close $fh or $self->die( "Can't close $perlvar: $!" );
return;
}
@@ -1111,7 +1151,7 @@ sub search_perlop {
# XXX FIXME: getting filehandles should probably be done in a single place
# especially since we need to support UTF8 or other encoding when dealing
# with perlop, perlfunc, perlapi, perlfaq[1-9]
- open( PERLOP, '<', $perlop ) or $self->die( "Can't open $perlop: $!" );
+ my $fh = $self->open_fh('<', $perlop);
my $thing = $self->opt_f;
@@ -1120,7 +1160,8 @@ sub search_perlop {
my $seen_item = 0;
my $skip = 1;
- while( my $line = <PERLOP> ) {
+ while( my $line = <$fh> ) {
+ $line =~ /^=encoding\s+(\S+)/ && $self->set_encoding($fh, $1);
# only start search after we hit the operator section
if ($line =~ m!^X<operator, regexp>!) {
$skip = 0;
@@ -1174,7 +1215,7 @@ sub search_perlop {
DEBUG > 4 and print "No pod from perlop\n";
}
- close PERLOP;
+ close $fh;
return;
}
@@ -1187,25 +1228,13 @@ sub search_perlapi {
DEBUG > 2 and print "Search: @$found_things\n";
my $perlapi = shift @$found_things;
- open(PAPI, "<", $perlapi) # "Funk is its own reward"
- or $self->die("Can't open $perlapi: $!");
+ my $fh = $self->open_fh('<', $perlapi);
my $search_re = quotemeta($self->opt_a);
DEBUG > 2 and
print "Going to perlapi-scan for $search_re in $perlapi\n";
- # Check available translator or backup to default (english)
- if ( $self->opt_L && defined $self->{'translators'}->[0] ) {
- my $tr = $self->{'translators'}->[0];
- if ( $] < 5.008 ) {
- $self->aside("Your old perl doesn't really have proper unicode support.");
- }
- else {
- binmode(PAPI, ":utf8");
- }
- }
-
local $_;
# Look for our function
@@ -1214,7 +1243,9 @@ sub search_perlapi {
my @related;
my $related_re;
- while (<PAPI>) { # "The Mothership Connection is here!"
+ while (<$fh>) {
+ /^=encoding\s+(\S+)/ && $self->set_encoding($fh, $1);
+
if ( m/^=item\s+$search_re\b/ ) {
$found = 1;
}
@@ -1251,7 +1282,7 @@ sub search_perlapi {
$self->opt_a )
;
}
- close PAPI or $self->die( "Can't open $perlapi: $!" );
+ close $fh or $self->die( "Can't open $perlapi: $!" );
return;
}
@@ -1263,16 +1294,15 @@ sub search_perlfunc {
DEBUG > 2 and print "Search: @$found_things\n";
- my $perlfunc = shift @$found_things;
- open(PFUNC, "<", $perlfunc) # "Funk is its own reward"
- or $self->die("Can't open $perlfunc: $!");
+ my $pfunc = shift @$found_things;
+ my $fh = $self->open_fh("<", $pfunc); # "Funk is its own reward"
# Functions like -r, -e, etc. are listed under `-X'.
my $search_re = ($self->opt_f =~ /^-[rwxoRWXOeszfdlpSbctugkTBMAC]$/)
? '(?:I<)?-X' : quotemeta($self->opt_f) ;
DEBUG > 2 and
- print "Going to perlfunc-scan for $search_re in $perlfunc\n";
+ print "Going to perlfunc-scan for $search_re in $pfunc\n";
my $re = 'Alphabetical Listing of Perl Functions';
@@ -1283,14 +1313,12 @@ sub search_perlfunc {
if ( $] < 5.008 ) {
$self->aside("Your old perl doesn't really have proper unicode support.");
}
- else {
- binmode(PFUNC, ":utf8");
- }
}
# Skip introduction
local $_;
- while (<PFUNC>) {
+ while (<$fh>) {
+ /^=encoding\s+(\S+)/ && $self->set_encoding($fh, $1);
last if /^=head2 $re/;
}
@@ -1302,7 +1330,7 @@ sub search_perlfunc {
my @related;
my $related_re;
- while (<PFUNC>) { # "The Mothership Connection is here!"
+ while (<$fh>) { # "The Mothership Connection is here!"
last if( grep{ $self->opt_f eq $_ }@perlops );
if ( /^=over/ and not $found ) {
@@ -1352,7 +1380,7 @@ sub search_perlfunc {
$self->opt_f )
;
}
- close PFUNC or $self->die( "Can't close $perlfunc: $!" );
+ close $fh or $self->die( "Can't close $pfunc: $!" );
return;
}
@@ -1377,9 +1405,9 @@ EOD
local $_;
foreach my $file (@$found_things) {
$self->die( "invalid file spec: $!" ) if $file =~ /[<>|]/;
- open(INFAQ, "<", $file) # XXX 5.6ism
- or $self->die( "Can't read-open $file: $!\nAborting" );
- while (<INFAQ>) {
+ my $fh = $self->open_fh("<", $file);
+ while (<$fh>) {
+ /^=encoding\s+(\S+)/ && $self->set_encoding($fh, $1);
if ( m/^=head2\s+.*(?:$search_key)/i ) {
$found = 1;
push @$pod, "=head1 Found in $file\n\n" unless $found_in{$file}++;
@@ -1390,7 +1418,7 @@ EOD
next unless $found;
push @$pod, $_;
}
- close(INFAQ);
+ close($fh);
}
CORE::die("No documentation for perl FAQ keyword '$search_key' found\n")
unless @$pod;
@@ -1614,6 +1642,9 @@ sub minus_f_nocase { # i.e., do like -f, but without regard to case
#..........................................................................
sub pagers_guessing {
+ # TODO: This whole subroutine needs to be rewritten. It's semi-insane
+ # right now.
+
my $self = shift;
my @pagers;
@@ -1650,6 +1681,7 @@ sub pagers_guessing {
unshift @pagers, "$ENV{PERLDOC_SRC_PAGER}" if $ENV{PERLDOC_SRC_PAGER}
}
else {
+ unshift @pagers, "$ENV{MANPAGER} <" if $ENV{MANPAGER};
unshift @pagers, "$ENV{PERLDOC_PAGER} <" if $ENV{PERLDOC_PAGER};
}
@@ -1729,9 +1761,9 @@ sub isprintable {
my $data;
local($_);
- open(TEST,"<", $file) or $self->die( "Can't open $file: $!" );
- read TEST, $data, $size;
- close TEST;
+ my $fh = $self->open_fh("<", $file);
+ read $fh, $data, $size;
+ close $fh;
$size= length($data);
$data =~ tr/\x09-\x0D\x20-\x7E//d;
return length($data) <= $size*$maxunprintfrac;
@@ -1764,14 +1796,14 @@ sub containspod {
}
local($_);
- open(TEST,"<", $file) or $self->die( "Can't open $file: $!" ); # XXX 5.6ism
- while (<TEST>) {
+ my $fh = $self->open_fh("<", $file);
+ while (<$fh>) {
if (/^=head/) {
- close(TEST) or $self->die( "Can't close $file: $!" );
+ close($fh) or $self->die( "Can't close $file: $!" );
return 1;
}
}
- close(TEST) or $self->die( "Can't close $file: $!" );
+ close($fh) or $self->die( "Can't close $file: $!" );
return 0;
}
@@ -1807,15 +1839,8 @@ sub new_output_file {
# Otherwise open a write-handle on opt_d!f
- my $fh;
- # If we are running before perl5.6.0, we can't autovivify
- if ($^V < 5.006) {
- require Symbol;
- $fh = Symbol::gensym();
- }
DEBUG > 3 and print "About to try writing to specified output file $outspec\n";
- $self->die( "Can't write-open $outspec: $!" )
- unless open($fh, ">", $outspec); # XXX 5.6ism
+ my $fh = $self->open_fh(">", $outspec);
DEBUG > 3 and print "Successfully opened $outspec\n";
binmode($fh) if $self->{'output_is_binary'};
@@ -1869,12 +1894,12 @@ sub page { # apply a pager to the output file
my ($self, $output, $output_to_stdout, @pagers) = @_;
if ($output_to_stdout) {
$self->aside("Sending unpaged output to STDOUT.\n");
- open(TMP, "<", $output) or $self->die( "Can't open $output: $!" ); # XXX 5.6ism
+ my $fh = $self->open_fh("<", $output);
local $_;
- while (<TMP>) {
+ while (<$fh>) {
print or $self->die( "Can't print to stdout: $!" );
}
- close TMP or $self->die( "Can't close while $output: $!" );
+ close $fh or $self->die( "Can't close while $output: $!" );
$self->unlink_if_temp_file($output);
} else {
# On VMS, quoting prevents logical expansion, and temp files with no
@@ -1892,6 +1917,9 @@ sub page { # apply a pager to the output file
if ($self->is_vms) {
last if system("$pager $output") == 0;
} else {
+ # fix visible escape codes in ToTerm output
+ # https://bugs.debian.org/758689
+ local $ENV{LESS} = defined $ENV{LESS} ? "$ENV{LESS} -R" : "-R";
last if system("$pager \"$output\"") == 0;
}
}
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm
index b216d426114..304da44ede2 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/BaseTo.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
use Carp qw(croak carp);
use Config qw(%Config);
@@ -106,7 +106,7 @@ Pod::Perldoc::BaseTo - Base for Pod::Perldoc formatters
package Pod::Perldoc::ToMyFormat;
- use base qw( Pod::Perldoc::BaseTo );
+ use parent qw( Pod::Perldoc::BaseTo );
...
=head1 DESCRIPTION
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/GetOptsOO.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/GetOptsOO.pm
index 3f4e218a946..71fcc7bc9a2 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/GetOptsOO.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/GetOptsOO.pm
@@ -2,7 +2,7 @@ package Pod::Perldoc::GetOptsOO;
use strict;
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
BEGIN { # Make a DEBUG constant ASAP
*DEBUG = defined( &Pod::Perldoc::DEBUG )
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToANSI.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToANSI.pm
index f0ecbced987..26a11d3c809 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToANSI.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToANSI.pm
@@ -4,7 +4,7 @@ use warnings;
use parent qw(Pod::Perldoc::BaseTo);
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
sub is_pageable { 1 }
sub write_with_binmode { 0 }
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToChecker.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToChecker.pm
index 8bff3381201..3d161acf51c 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToChecker.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToChecker.pm
@@ -4,7 +4,7 @@ use warnings;
use vars qw(@ISA);
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
# Pick our superclass...
#
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToMan.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToMan.pm
index 1080dbd93e0..e22e05044d1 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToMan.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToMan.pm
@@ -5,7 +5,7 @@ use warnings;
use parent qw(Pod::Perldoc::BaseTo);
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
use File::Spec::Functions qw(catfile);
use Pod::Man 2.18;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToNroff.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToNroff.pm
index 9777581db23..ac4a8aa17d4 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToNroff.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToNroff.pm
@@ -4,7 +4,7 @@ use warnings;
use parent qw(Pod::Perldoc::BaseTo);
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
# This is unlike ToMan.pm in that it emits the raw nroff source!
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToPod.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToPod.pm
index 97185bbb42d..8433e8ca409 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToPod.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToPod.pm
@@ -4,7 +4,7 @@ use warnings;
use parent qw(Pod::Perldoc::BaseTo);
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
sub is_pageable { 1 }
sub write_with_binmode { 0 }
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToRtf.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToRtf.pm
index 588405715bb..81f019f8a20 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToRtf.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToRtf.pm
@@ -4,7 +4,7 @@ use warnings;
use parent qw( Pod::Simple::RTF );
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
sub is_pageable { 0 }
sub write_with_binmode { 0 }
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTerm.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTerm.pm
index 693b52a9059..e97a775e10e 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTerm.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTerm.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
use parent qw(Pod::Perldoc::BaseTo);
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToText.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToText.pm
index 07f44cd5630..dbd47438d3a 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToText.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToText.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
use parent qw(Pod::Perldoc::BaseTo);
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTk.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTk.pm
index 627289e88a1..40b51c5b438 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTk.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToTk.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
use parent qw(Pod::Perldoc::BaseTo);
diff --git a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToXml.pm b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToXml.pm
index 5c86b3ebda1..9da514f7f61 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToXml.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Perldoc/ToXml.pm
@@ -6,7 +6,7 @@ use vars qw($VERSION);
use parent qw( Pod::Simple::XMLOutStream );
use vars qw($VERSION);
-$VERSION = '3.23';
+$VERSION = '3.25';
sub is_pageable { 0 }
sub write_with_binmode { 0 }
diff --git a/Master/tlpkg/tlperl/lib/Pod/Select.pm b/Master/tlpkg/tlperl/lib/Pod/Select.pm
index 6657def58fd..70267e94ec0 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Select.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Select.pm
@@ -11,7 +11,7 @@ package Pod::Select;
use strict;
use vars qw($VERSION @ISA @EXPORT $MAX_HEADING_LEVEL %myData @section_headings @selected_sections);
-$VERSION = '1.62'; ## Current version of this package
+$VERSION = '1.63'; ## Current version of this package
require 5.005; ## requires this Perl version or later
#############################################################################
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple.pm b/Master/tlpkg/tlperl/lib/Pod/Simple.pm
index fb5438f7f71..538969d9fb2 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple.pm
@@ -18,7 +18,7 @@ use vars qw(
);
@ISA = ('Pod::Simple::BlackBox');
-$VERSION = '3.28';
+$VERSION = '3.29';
@Known_formatting_codes = qw(I B C L E F S X Z);
%Known_formatting_codes = map(($_=>1), @Known_formatting_codes);
@@ -105,7 +105,7 @@ __PACKAGE__->_accessorize(
# $pod_handler->($line, $self->{'line_count'}, $self) if $pod_handler;
# $wl_handler->($line, $self->{'line_count'}, $self) if $wl_handler;
'parse_empty_lists', # whether to acknowledge empty =over/=back blocks
-
+ 'raw_mode', # to report entire raw lines instead of Pod elements
);
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@ -487,7 +487,7 @@ sub parse_from_file {
} elsif(ref(\$source) eq 'GLOB') { # stet
} elsif(ref($source) ) { # stet
} elsif(!length $source
- or $source eq '-' or $source =~ m/^<&(STDIN|0)$/i
+ or $source eq '-' or $source =~ m/^<&(?:STDIN|0)$/i
) {
$source = *STDIN{IO};
}
@@ -499,6 +499,8 @@ sub parse_from_file {
or $to eq '-' or $to =~ m/^>&?(?:STDOUT|1)$/i
) {
$self->output_fh( *STDOUT{IO} );
+ } elsif($to =~ m/^>&(?:STDERR|2)$/i) {
+ $self->output_fh( *STDERR{IO} );
} else {
require Symbol;
my $out_fh = Symbol::gensym();
@@ -1439,6 +1441,14 @@ 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.
@@ -1457,8 +1467,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/\xA0/g if ASCII and $in_s;
- # (If not in ASCIIland, we can't assume that \xA0 == nbsp.)
+ $treelet->[$i] =~ s/\s/$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/Master/tlpkg/tlperl/lib/Pod/Simple.pod b/Master/tlpkg/tlperl/lib/Pod/Simple.pod
index 4edc08ed677..aadba19e941 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple.pod
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple.pod
@@ -42,8 +42,8 @@ of Pod::Simple.
=item C<< $parser->output_fh( *OUT ); >>
This sets the filehandle that C<$parser>'s output will be written to.
-You can pass C<*STDOUT>, otherwise you should probably do something
-like this:
+You can pass C<*STDOUT> or C<*STDERR>, otherwise you should probably do
+something like this:
my $outfile = "output.txt";
open TXTOUT, ">$outfile" or die "Can't write to $outfile: $!";
@@ -183,7 +183,7 @@ verbatim blocks will be preserved in the output. This can be annoying for
outputs such as HTML, where that whitespace will remain in front of every
line. It's an unfortunate case where syntax is turned into semantics.
-If the POD your parsing adheres to a consistent indentation policy, you can
+If the POD you're parsing adheres to a consistent indentation policy, you can
have such indentation stripped from the beginning of every line of your
verbatim blocks. This method tells Pod::Simple what to strip. For two-space
indents, you'd use:
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm
index a1b570810d0..ee6e747a6a0 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/BlackBox.pm
@@ -1,4 +1,3 @@
-
package Pod::Simple::BlackBox;
#
# "What's in the box?" "Pain."
@@ -23,7 +22,7 @@ use integer; # vroom!
use strict;
use Carp ();
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
#use constant DEBUG => 7;
BEGIN {
require Pod::Simple;
@@ -127,13 +126,25 @@ 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 =~ /[^\x00-\x7f]/
+ && $line =~ /[[:^ascii:]]/
) {
- my $encoding = $line =~ /^[\x00-\x7f]*[\xC0-\xFD][\x80-\xBF]/ ? 'UTF-8' : 'ISO8859-1';
+ 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';
+ }
$self->_handle_encoding_line( "=encoding $encoding" );
+ delete $self->{'_processed_encoding'};
$self->{'_transcoder'} && $self->{'_transcoder'}->($line);
- my ($word) = $line =~ /(\S*[^\x00-\x7f]\S*)/;
+ my ($word) = $line =~ /(\S*[[:^ascii:]]\S*)/;
$self->whine(
$self->{'line_count'},
@@ -376,8 +387,8 @@ sub _handle_encoding_line {
}
push @{ $self->{'encoding_command_statuses'} }, $enc_error;
if (defined($self->{'_processed_encoding'})) {
- # Should never happen
- die "Nested processed encoding.";
+ # Double declaration.
+ $self->scream( $self->{'line_count'}, 'Cannot have multiple =encoding directives');
}
$self->{'_processed_encoding'} = $orig;
@@ -1980,20 +1991,20 @@ sub pretty { # adopted from Class::Classless
$_ eq '0' # very common case
or(
m/^-?(?:[123456789]\d*|0)(?:\.\d+)?$/s
- and $_ ne '-0' # the strange case that that RE lets thru
+ and $_ ne '-0' # the strange case that RE lets thru
)
) { $_;
} else {
- if( chr(65) eq 'A' ) {
- s<([^\x20\x21\x23\x27-\x3F\x41-\x5B\x5D-\x7E])>
- #<$pretty_form{$1} || '\\x'.(unpack("H2",$1))>eg;
+ # Yes, explicitly name every character desired. There are shorcuts one
+ # could make, but I (Karl Williamson) was afraid that some Perl
+ # releases would have bugs in some of them. For example [A-Z] works
+ # even on EBCDIC platforms to match exactly the 26 uppercase English
+ # letters, but I don't know if it has always worked without bugs. It
+ # seemed safest just to list the characters.
+ # s<([^\x20\x21\x23\x27-\x3F\x41-\x5B\x5D-\x7E])>
+ s<([^ !#'()*+,\-./0123456789:;\<=\>?ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\]^_`abcdefghijklmnopqrstuvwxyz{|}~])>
<$pretty_form{$1} || '\\x{'.sprintf("%x", ord($1)).'}'>eg;
- } else {
- # We're in some crazy non-ASCII world!
- s<([^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789])>
#<$pretty_form{$1} || '\\x'.(unpack("H2",$1))>eg;
- <$pretty_form{$1} || '\\x{'.sprintf("%x", ord($1)).'}'>eg;
- }
qq{"$_"};
}
} @stuff;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm
index 92e1bee238a..3ef64eea650 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Checker.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm
index b170bb780ab..2bbd50a6643 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Debug.pm
@@ -1,9 +1,8 @@
-
require 5;
package Pod::Simple::Debug;
use strict;
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
sub import {
my($value,$variable);
@@ -97,7 +96,7 @@ Note that you should load this module I<before> loading Pod::Simple (or
any Pod::Simple-based class). If you try loading Pod::Simple::Debug
after &Pod::Simple::DEBUG is already defined, Pod::Simple::Debug will
throw a fatal error to the effect that
-"it's s too late to call Pod::Simple::Debug".
+"It's too late to call Pod::Simple::Debug".
Note that the C<use Pod::Simple::Debug (\$x, I<somenum>)> mode will make
Pod::Simple (et al) run rather slower, since &Pod::Simple::DEBUG won't
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm
index 019dfd57fbd..dfde4d66b2c 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsText.pm
@@ -1,7 +1,7 @@
require 5;
package Pod::Simple::DumpAsText;
-$VERSION = '3.28';
+$VERSION = '3.29';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
@@ -54,7 +54,7 @@ sub _handle_text {
[^\n]{55} # Snare some characters from a line
[^\n\ ]{0,50} # and finish any current word
)
- \x20{1,10}(?!\n) # capture some spaces not at line-end
+ \ {1,10}(?!\n) # capture some spaces not at line-end
/$1"\n$indent . "/gx # => line-break here
;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
index ac925c08eff..4db6a061494 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
@@ -1,7 +1,7 @@
require 5;
package Pod::Simple::DumpAsXML;
-$VERSION = '3.28';
+$VERSION = '3.29';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm
index 8a2f81569c1..2c6494b9ba2 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/HTML.pm
@@ -1,4 +1,3 @@
-
require 5;
package Pod::Simple::HTML;
use strict;
@@ -10,8 +9,7 @@ use vars qw(
$Doctype_decl $Content_decl
);
@ISA = ('Pod::Simple::PullParser');
-$VERSION = '3.28';
-
+$VERSION = '3.29';
BEGIN {
if(defined &DEBUG) { } # no-op
elsif( defined &Pod::Simple::DEBUG ) { *DEBUG = \&Pod::Simple::DEBUG }
@@ -75,6 +73,7 @@ __PACKAGE__->_accessorize(
'html_header_before_title',
'html_header_after_title',
'html_footer',
+ 'top_anchor',
'index', # whether to add an index at the top of each page
# (actually it's a table-of-contents, but we'll call it an index,
@@ -209,6 +208,7 @@ sub new {
"<!-- start doc -->\n",
);
$new->html_footer( qq[\n<!-- end doc -->\n\n</body></html>\n] );
+ $new->top_anchor( "<a name='___top' class='dummyTopAnchor' ></a>\n" );
$new->{'Tagmap'} = {%Tagmap};
@@ -312,7 +312,7 @@ sub do_beginning {
sub _add_top_anchor {
my($self, $text_r) = @_;
unless($$text_r and $$text_r =~ m/name=['"]___top['"]/) { # a hack
- $$text_r .= "<a name='___top' class='dummyTopAnchor' ></a>\n";
+ $$text_r .= $self->top_anchor || '';
}
return;
}
@@ -524,7 +524,9 @@ sub _do_middle_main_loop {
next;
}
DEBUG and print " raw text ", $next->text, "\n";
- print $fh "\n" . $next->text . "\n";
+ # The parser sometimes preserves newlines and sometimes doesn't!
+ (my $text = $next->text) =~ s/\n\z//;
+ print $fh $text, "\n";
next;
} else {
@@ -969,7 +971,7 @@ Set the content-type in the HTML head: (defaults to ISO-8859-1)
$Pod::Simple::HTML::Content_decl = q{<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >};
-Set the value that will be ebedded in the opening tags of F, C tags and verbatim text.
+Set the value that will be embedded in the opening tags of F, C tags and verbatim text.
F maps to <em>, C maps to <code>, Verbatim text maps to <pre> (Computerese defaults to "")
$Pod::Simple::HTML::Computerese = ' class="some_class_name';
@@ -990,6 +992,13 @@ file:
$p->html_header_before_title('<html><head><title>');
+=head2 top_anchor
+
+By default Pod::Simple::HTML adds a dummy anchor at the top of the HTML.
+You can change it by calling
+
+ $p->top_anchor('<a name="zz" >');
+
=head2 html_h_level
Normally =head1 will become <h1>, =head2 will become <h2> etc.
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm
index e41b11e2c50..19e700b825f 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/HTMLBatch.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
@ISA = (); # Yup, we're NOT a subclass of Pod::Simple::HTML!
# TODO: nocontents stylesheets. Strike some of the color variations?
@@ -1310,18 +1310,6 @@ TODO
that classname
-
-=head1 ASK ME!
-
-If you want to do some kind of big pod-to-HTML version with some
-particular kind of option that you don't see how to achieve using this
-module, email me (C<sburke@cpan.org>) and I'll probably have a good idea
-how to do it. For reasons of concision and energetic laziness, some
-methods and options in this module (and the dozen modules it depends on)
-are undocumented; but one of those undocumented bits might be just what
-you're looking for.
-
-
=head1 SEE ALSO
L<Pod::Simple>, L<Pod::Simple::HTMLBatch>, L<perlpod>, L<perlpodspec>
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm
index be1f5345d08..2139509303e 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/LinkSection.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
use strict;
use Pod::Simple::BlackBox;
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
use overload( # So it'll stringify nice
'""' => \&Pod::Simple::BlackBox::stringify_lol,
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Methody.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Methody.pm
index 38acaa20d0b..d867b1ce932 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Methody.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
@ISA = ('Pod::Simple');
# Yes, we could use named variables, but I want this to be impose
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm
index f9cd6816722..3a87b998423 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Progress.pm
@@ -1,7 +1,7 @@
require 5;
package Pod::Simple::Progress;
-$VERSION = '3.28';
+$VERSION = '3.29';
use strict;
# Objects of this class are used for noting progress of an
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm
index 5c13724dc11..0e47ec3413b 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParser.pm
@@ -1,7 +1,6 @@
-
require 5;
package Pod::Simple::PullParser;
-$VERSION = '3.28';
+$VERSION = '3.29';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
@@ -688,7 +687,7 @@ If the title can't be found, then get_short_title returns empty-string
This works like get_title except that it returns the contents of the
"=head1 AUTHOR\n\nParagraph...\n" section, assuming that that section
isn't terribly long. To recognize a "=head1 Author\n\nParagraph\n"
-section, pass the C<nocase> otpion:
+section, pass the C<nocase> option:
$parser->get_author(nocase => 1);
@@ -699,7 +698,7 @@ section, pass the C<nocase> otpion:
This works like get_title except that it returns the contents of the
"=head1 DESCRIPTION\n\nParagraph...\n" section, assuming that that section
isn't terribly long. To recognize a "=head1 Description\n\nParagraph\n"
-section, pass the C<nocase> otpion:
+section, pass the C<nocase> option:
$parser->get_description(nocase => 1);
@@ -708,7 +707,7 @@ section, pass the C<nocase> otpion:
This works like get_title except that it returns the contents of
the "=head1 VERSION\n\n[BIG BLOCK]\n" block. Note that this does NOT
return the module's C<$VERSION>!! To recognize a
-"=head1 Version\n\n[BIG BLOCK]\n" section, pass the C<nocase> otpion:
+"=head1 Version\n\n[BIG BLOCK]\n" section, pass the C<nocase> option:
$parser->get_version(nocase => 1);
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm
index 5fa402318eb..bb5ac7adbfe 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserEndToken.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
sub new { # Class->new(tagname);
my $class = shift;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserStartToken.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserStartToken.pm
index 3edb0ad5695..dbb0b2c859f 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserStartToken.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
sub new { # Class->new(tagname, optional_attrhash);
my $class = shift;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserTextToken.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserTextToken.pm
index a75fd7a706e..9db7f1ee8fc 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserTextToken.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
sub new { # Class->new(text);
my $class = shift;
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserToken.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserToken.pm
index bbae51ba69e..46ab1fd4d3a 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/PullParserToken.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
use strict;
sub new { # Class->new('type', stuff...); ## Overridden in derived classes anyway
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/RTF.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/RTF.pm
index 067e6b9dd35..617190418b6 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/RTF.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
use Pod::Simple::PullParser ();
BEGIN {@ISA = ('Pod::Simple::PullParser')}
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
index 15cb292fc50..49df34d3543 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Search.pm
@@ -1,10 +1,9 @@
-
require 5.005;
package Pod::Simple::Search;
use strict;
use vars qw($VERSION $MAX_VERSION_WITHIN $SLEEPY);
-$VERSION = '3.28'; ## Current version of this package
+$VERSION = '3.29'; ## Current version of this package
BEGIN { *DEBUG = sub () {0} unless defined &DEBUG; } # set DEBUG level
use Carp ();
@@ -768,7 +767,6 @@ are produced. (Setting verbose to 1 turns on some messages, and setting
it to 2 turns on even more messages, i.e., makes the following search(es)
even more verbose than 1 would make them.)
-
=item $search->limit_glob( I<some-glob-string> );
This option means that you want to limit the results just to items whose
@@ -806,6 +804,10 @@ seeing only files with Perl-like extensions, omitting subdirectories
that are numeric but do I<not> match the current Perl interpreter's
version ID, suppressing F<site_perl> as a module hierarchy name, etc.
+=item $search->recurse( I<true-or-false> );
+
+Unless you set this attribute to a false value, Pod::Search will
+recurse into subdirectories of the search directories.
=item $search->shadows( I<true-or-false> );
@@ -834,7 +836,7 @@ C<limit_glob> attribute is used instead.
Setting this attribute to a string value means that the searches should
begin in the specified subdirectory name (like "Pod" or "File::Find",
-also expressable as "File/Find"). For example, the search option
+also expressible as "File/Find"). For example, the search option
C<< $search->limit_glob("File::Find::R*") >>
is the same as the combination of the search options
C<< $search->limit_re("^File::Find::R") -> dir_prefix("File::Find") >>.
@@ -942,8 +944,7 @@ version than the system's general path dirs in general.)
The options to this argument is a list of either directories that are
searched recursively, or files. (Usually you wouldn't specify files,
but just dirs.) Or you can just specify an empty-list, as in
-$name2path; with the
-C<inc> option on, as it is by default, teh
+$name2path; with the C<inc> option on, as it is by default.
The POD names of files are the plain basenames with any Perl-like
extension (.pm, .pl, .pod) stripped, and path separators replaced by
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm
index 0b42a22b273..201e37aac95 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/SimpleTree.pm
@@ -1,12 +1,11 @@
-
require 5;
package Pod::Simple::SimpleTree;
use strict;
use Carp ();
use Pod::Simple ();
use vars qw( $ATTR_PAD @ISA $VERSION $SORT_ATTRS);
-$VERSION = '3.28';
+$VERSION = '3.29';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
@@ -121,7 +120,7 @@ the form: C<[ I<elementname>, \%attributes, I<...subnodes...> ]>.
See the example tree dump in the Synopsis, above.
Every text node in the tree is represented by a simple (non-ref)
-string scalar. So you can test C<ref($node)> to see whather you have
+string scalar. So you can test C<ref($node)> to see whether you have
an element node or just a text node.
The top node in the tree is C<[ 'Document', \%attributes,
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod b/Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod
index 7a7976bdc47..e3f09a34e1b 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Subclassing.pod
@@ -1,4 +1,3 @@
-
=head1 NAME
Pod::Simple::Subclassing -- write a formatter as a Pod::Simple subclass
@@ -38,7 +37,7 @@ generally a Pod formatter. If you just want to know about using an
existing Pod formatter, instead see its documentation and see also the
docs in L<Pod::Simple>.
-The zeroeth step in writing a Pod formatter is to make sure that there
+B<The zeroeth step> in writing a Pod formatter is to make sure that there
isn't already a decent one in CPAN. See L<http://search.cpan.org/>, and
run a search on the name of the format you want to render to. Also
consider joining the Pod People list
@@ -46,29 +45,47 @@ L<http://lists.perl.org/showlist.cgi?name=pod-people> and asking whether
anyone has a formatter for that format -- maybe someone cobbled one
together but just hasn't released it.
-The first step in writing a Pod processor is to read L<perlpodspec>,
+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
largely taken care of by Pod::Simple), but also a lot of requirements
and recommendations for writing a formatter.
-The second step is to actually learn the format you're planning to
+B<The second step> is to actually learn the format you're planning to
format to -- or at least as much as you need to know to represent Pod,
which probably isn't much.
-The third step is to pick which of Pod::Simple's interfaces you want to
-use -- the basic interface via Pod::Simple or L<Pod::Simple::Methody> is
-event-based, sort of like L<HTML::Parser>'s interface, or sort of like
-L<XML::Parser>'s "Handlers" interface), but L<Pod::Simple::PullParser>
-provides a token-stream interface, sort of like L<HTML::TokeParser>'s
-interface; L<Pod::Simple::SimpleTree> provides a simple tree interface,
-rather like XML::Parser's "Tree" interface. Users familiar with
-XML-handling will find one of these styles relatively familiar; but if
-you would be even more at home with XML, there are classes 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.
-
-The last step is to write your code based on how the events (or tokens,
+B<The third step> is to pick which of Pod::Simple's interfaces you want to
+use:
+
+=over
+
+=item Pod::Simple
+
+The basic L<Pod::Simple> interface that uses C<_handle_element_start()>,
+C<_handle_element_end()> and C<_handle_text()>.
+
+=item Pod::Simple::Methody
+
+The L<Pod::Simple::Methody> interface is event-based, similar to that of
+L<HTML::Parser> or L<XML::Parser>'s "Handlers".
+
+=item Pod::Simple::PullParser
+
+L<Pod::Simple::PullParser> provides a token-stream interface, sort of
+like L<HTML::TokeParser>'s interface.
+
+=item Pod::Simple::SimpleTree
+
+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,
+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.
+
+=back
+
+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
@@ -545,7 +562,7 @@ an "<UL><LI>...</LI>...</UL>" structure), but which any processor may use.
Note that the values for the I<number> attributes of "item-number"
elements in a given "over-number" area I<will> start at 1 and go up by
one each time. If the Pod source doesn't follow that order (even though
-it really should should!), whatever numbers it has will be ignored (with
+it really should!), whatever numbers it has will be ignored (with
the correct values being put in the I<number> attributes), and an error
message might be issued to the user.
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm
index bd1a5416df8..b3292f8c498 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Text.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
@ISA = ('Pod::Simple::Methody');
BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
? \&Pod::Simple::DEBUG
@@ -14,7 +14,8 @@ BEGIN { *DEBUG = defined(&Pod::Simple::DEBUG)
}
use Text::Wrap 98.112902 ();
-$Text::Wrap::wrap = 'overflow';
+$Text::Wrap::huge = 'overflow';
+
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub new {
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm
index 6788df6d762..516f28cb223 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/TextContent.pm
@@ -6,7 +6,7 @@ use strict;
use Carp ();
use Pod::Simple ();
use vars qw( @ISA $VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
@ISA = ('Pod::Simple');
sub new {
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm
index 0b2fb2f8c49..dbf5210388e 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/TiedOutFH.pm
@@ -4,7 +4,7 @@ package Pod::Simple::TiedOutFH;
use Symbol ('gensym');
use Carp ();
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm
index 9e835048a0e..9c60f05d021 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/Transcode.pm
@@ -2,7 +2,7 @@
require 5;
package Pod::Simple::Transcode;
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
BEGIN {
if(defined &DEBUG) {;} # Okay
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm
index 4749e9af198..badb9a0d439 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeDumb.pm
@@ -5,7 +5,7 @@ require 5;
package Pod::Simple::TranscodeDumb;
use strict;
use vars qw($VERSION %Supported);
-$VERSION = '3.28';
+$VERSION = '3.29';
# This module basically pretends it knows how to transcode, except
# only for null-transcodings! We use this when Encode isn't
# available.
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm
index 06fdb9f2750..6735b9979b3 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Simple/TranscodeSmart.pm
@@ -9,7 +9,7 @@ use strict;
use Pod::Simple;
require Encode;
use vars qw($VERSION );
-$VERSION = '3.28';
+$VERSION = '3.29';
sub is_dumb {0}
sub is_smart {1}
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/XHTML.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/XHTML.pm
index df896e64a7c..3a2d2094c68 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/XHTML.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
use Pod::Simple::Methody ();
@ISA = ('Pod::Simple::Methody');
@@ -132,7 +132,7 @@ A document type tag for the file. This option is not set by default.
=head2 html_charset
-The charater set to declare in the Content-Type meta tag created by default
+The character set to declare in the Content-Type meta tag created by default
for C<html_header_tags>. Note that this option will be ignored if the value of
C<html_header_tags> is changed. Defaults to "ISO-8859-1".
@@ -313,9 +313,9 @@ The base implementation just escapes the text.
The callback methods C<start_code> and C<end_code> emits the C<code> tags
before and after C<handle_code> is invoked, so you might want to override these
-together with C<handle_code> if this wrapping isn't suiteable.
+together with C<handle_code> if this wrapping isn't suitable.
-Note that the code might be broken into mulitple segments if there are
+Note that the code might be broken into multiple segments if there are
nested formatting codes inside a C<< CE<lt>...> >> sequence. In between the
calls to C<handle_code> other markup tags might have been emitted in that
case. The same is true for verbatim sections if the C<codes_in_verbatim>
@@ -352,7 +352,23 @@ sub handle_text {
# literal xhtml region, since handle_code calls encode_entities.
$_[0]->handle_code( $_[1], $_[0]{'in_code'}[-1] );
} else {
- $_[0]{'scratch'} .= $text;
+ if ($_[0]->{in_for}) {
+ my $newlines = $_[0]->__in_literal_xhtml_region ? "\n\n" : '';
+ if ($_[0]->{started_for}) {
+ if ($text =~ /\S/) {
+ delete $_[0]->{started_for};
+ $_[0]{'scratch'} .= $text . $newlines;
+ }
+ # Otherwise, append nothing until we have something to append.
+ } else {
+ # The parser sometimes preserves newlines and sometimes doesn't!
+ $text =~ s/\n\z//;
+ $_[0]{'scratch'} .= $text . $newlines;
+ }
+ } else {
+ # Just plain text.
+ $_[0]{'scratch'} .= $text;
+ }
}
$_[0]{htext} .= $text if $_[0]{'in_head'};
@@ -371,7 +387,7 @@ sub handle_code {
}
sub start_Para {
- $_[0]{'scratch'} = '<p>';
+ $_[0]{'scratch'} .= '<p>';
}
sub start_Verbatim {
@@ -496,20 +512,27 @@ sub start_for {
my ($self, $flags) = @_;
push @{ $self->{__region_targets} }, $flags->{target_matching};
+ $self->{started_for} = 1;
+ $self->{in_for} = 1;
unless ($self->__in_literal_xhtml_region) {
$self->{scratch} .= '<div';
$self->{scratch} .= qq( class="$flags->{target}") if $flags->{target};
- $self->{scratch} .= '>';
+ $self->{scratch} .= ">\n\n";
}
-
- $self->emit;
-
}
+
sub end_for {
my ($self) = @_;
+ delete $self->{started_for};
+ delete $self->{in_for};
- $self->{'scratch'} .= '</div>' unless $self->__in_literal_xhtml_region;
+ if ($self->__in_literal_xhtml_region) {
+ # Remove trailine newlines.
+ $self->{'scratch'} =~ s/\s+\z//s;
+ } else {
+ $self->{'scratch'} .= '</div>';
+ }
pop @{ $self->{__region_targets} };
$self->emit;
@@ -526,16 +549,17 @@ sub start_Document {
$title = $self->force_title || $self->title || $self->default_title || '';
$metatags = $self->html_header_tags || '';
if (my $css = $self->html_css) {
- $metatags .= $css;
if ($css !~ /<link/) {
# this is required to be compatible with Pod::Simple::BatchHTML
$metatags .= '<link rel="stylesheet" href="'
. $self->encode_entities($css) . '" type="text/css" />';
+ } else {
+ $metatags .= $css;
}
}
if ($self->html_javascript) {
$metatags .= qq{\n<script type="text/javascript" src="} .
- $self->html_javascript . "'></script>";
+ $self->html_javascript . '"></script>';
}
$bodyid = $self->backlink ? ' id="_podtop_"' : '';
$self->{'scratch'} .= <<"HTML";
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm
index 47496e2577f..a0f50a20fb2 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Simple/XMLOutStream.pm
+++ b/Master/tlpkg/tlperl/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.28';
+$VERSION = '3.29';
BEGIN {
@ISA = ('Pod::Simple');
*DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG;
@@ -125,19 +125,6 @@ The older (and possibly obsolete) libraries L<Pod::PXML>, L<Pod::XML>
TODO: An example or two of =extend, then point to Pod::Simple::Subclassing
-
-=head1 ASK ME!
-
-If you actually want to use Pod as a format that you want to render to
-XML (particularly if to an XML instance with more elements than normal
-Pod has), please email me (C<sburke@cpan.org>) and I'll probably have
-some recommendations.
-
-For reasons of concision and energetic laziness, some methods and
-options in this module (and the dozen modules it depends on) are
-undocumented; but one of those undocumented bits might be just what
-you're looking for.
-
=head1 SEE ALSO
L<Pod::Simple>, L<Pod::Simple::Text>, L<Pod::Spell>
diff --git a/Master/tlpkg/tlperl/lib/Pod/Usage.pm b/Master/tlpkg/tlperl/lib/Pod/Usage.pm
index f0dd8350f12..bb8e60f05b0 100644
--- a/Master/tlpkg/tlperl/lib/Pod/Usage.pm
+++ b/Master/tlpkg/tlperl/lib/Pod/Usage.pm
@@ -11,7 +11,7 @@ package Pod::Usage;
use strict;
use vars qw($VERSION @ISA @EXPORT);
-$VERSION = '1.63'; ## Current version of this package
+$VERSION = '1.64'; ## Current version of this package
require 5.006; ## requires this Perl version or later
#use diagnostics;
@@ -360,7 +360,7 @@ __END__
=head1 NAME
-Pod::Usage, pod2usage() - print a usage message from embedded pod documentation
+Pod::Usage - print a usage message from embedded pod documentation
=head1 SYNOPSIS
@@ -594,13 +594,15 @@ use them by default if you don't expressly tell it to do otherwise. The
ability of B<pod2usage()> to accept a single number or a string makes it
convenient to use as an innocent looking error message handling function:
+ use strict;
use Pod::Usage;
use Getopt::Long;
## Parse options
- GetOptions("help", "man", "flag1") || pod2usage(2);
- pod2usage(1) if ($opt_help);
- pod2usage(-verbose => 2) if ($opt_man);
+ my %opt;
+ GetOptions(\%opt, "help|?", "man", "flag1") || pod2usage(2);
+ pod2usage(1) if ($opt{help});
+ pod2usage(-exitval => 0, -verbose => 2) if ($opt{man});
## Check for too many filenames
pod2usage("$0: Too many files given.\n") if (@ARGV > 1);
@@ -609,23 +611,35 @@ Some user's however may feel that the above "economy of expression" is
not particularly readable nor consistent and may instead choose to do
something more like the following:
- use Pod::Usage;
- use Getopt::Long;
+ use strict;
+ use Pod::Usage qw(pod2usage);
+ use Getopt::Long qw(GetOptions);
## Parse options
- GetOptions("help", "man", "flag1") || pod2usage(-verbose => 0);
- pod2usage(-verbose => 1) if ($opt_help);
- pod2usage(-verbose => 2) if ($opt_man);
+ my %opt;
+ GetOptions(\%opt, "help|?", "man", "flag1") ||
+ pod2usage(-verbose => 0);
+
+ pod2usage(-verbose => 1) if ($opt{help});
+ pod2usage(-verbose => 2) if ($opt{man});
## Check for too many filenames
pod2usage(-verbose => 2, -message => "$0: Too many files given.\n")
- if (@ARGV > 1);
+ if (@ARGV > 1);
+
As with all things in Perl, I<there's more than one way to do it>, and
B<pod2usage()> adheres to this philosophy. If you are interested in
seeing a number of different ways to invoke B<pod2usage> (although by no
means exhaustive), please refer to L<"EXAMPLES">.
+=head2 Scripts
+
+The Pod::Usage distribution comes with a script pod2usage which offers
+a command line interface to the functionality of Pod::Usage. See
+L<pod2usage>.
+
+
=head1 EXAMPLES
Each of the following invocations of C<pod2usage()> will print just the
@@ -709,8 +723,9 @@ provide a means of printing their complete documentation to C<STDOUT>
uses B<Pod::Usage> in combination with B<Getopt::Long> to do all of these
things:
- use Getopt::Long;
- use Pod::Usage;
+ use strict;
+ use Getopt::Long qw(GetOptions);
+ use Pod::Usage qw(pod2usage);
my $man = 0;
my $help = 0;
@@ -723,6 +738,7 @@ things:
## If no arguments were given, then allow STDIN to be used only
## if it's not connected to a terminal (otherwise print usage)
pod2usage("$0: No files given.") if ((@ARGV == 0) && (-t STDIN));
+
__END__
=head1 NAME
@@ -739,7 +755,7 @@ things:
=head1 OPTIONS
- =over 8
+ =over 4
=item B<-help>