summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm20
1 files changed, 11 insertions, 9 deletions
diff --git a/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm b/Master/tlpkg/tlperl/lib/Pod/Simple/DumpAsXML.pm
index 4db6a061494..bd3919852c7 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.29';
+$VERSION = '3.32';
use Pod::Simple ();
BEGIN {@ISA = ('Pod::Simple')}
@@ -27,7 +27,7 @@ sub _handle_element_start {
# ($self, $element_name, $attr_hash_r)
my $fh = $_[0]{'output_fh'};
my($key, $value);
- DEBUG and print "++ $_[1]\n";
+ DEBUG and print STDERR "++ $_[1]\n";
print $fh ' ' x ($_[0]{'indent'} || 0), "<", $_[1];
@@ -46,7 +46,7 @@ sub _handle_element_start {
}
sub _handle_text {
- DEBUG and print "== \"$_[1]\"\n";
+ DEBUG and print STDERR "== \"$_[1]\"\n";
if(length $_[1]) {
my $indent = ' ' x $_[0]{'indent'};
my $text = $_[1];
@@ -59,7 +59,7 @@ sub _handle_text {
}
sub _handle_element_end {
- DEBUG and print "-- $_[1]\n";
+ DEBUG and print STDERR "-- $_[1]\n";
print {$_[0]{'output_fh'}}
' ' x --$_[0]{'indent'}, "</", $_[1], ">\n";
return;
@@ -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;
}
@@ -128,8 +130,8 @@ pod-people@perl.org mail list. Send an empty email to
pod-people-subscribe@perl.org to subscribe.
This module is managed in an open GitHub repository,
-L<https://github.com/theory/pod-simple/>. Feel free to fork and contribute, or
-to clone L<git://github.com/theory/pod-simple.git> and send patches!
+L<https://github.com/perl-pod/pod-simple/>. Feel free to fork and contribute, or
+to clone L<git://github.com/perl-pod/pod-simple.git> and send patches!
Patches against Pod::Simple are welcome. Please send bug reports to
<bug-pod-simple@rt.cpan.org>.