From d0551e7362dcfdf0d37c8900b7c6372851ee7f19 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Sat, 5 Apr 2003 20:38:30 +0000 Subject: [PATCH] [perl #21839] perluniintro.pod: nice_string() doesn't escape literal escape chars -- use Sadahiro-san's fix(es). p4raw-id: //depot/perl@19148 --- pod/perluniintro.pod | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pod/perluniintro.pod b/pod/perluniintro.pod index f18cdee..feee902 100644 --- a/pod/perluniintro.pod +++ b/pod/perluniintro.pod @@ -451,7 +451,7 @@ displayed as C<\x..>, and the rest of the characters as themselves: sprintf("\\x{%04X}", $_) : # \x{...} chr($_) =~ /[[:cntrl:]]/ ? # else if control character ... sprintf("\\x%02X", $_) : # \x.. - chr($_) # else as themselves + quotemeta(chr($_)) # else quoted or as themselves } unpack("U*", $_[0])); # unpack Unicode characters } @@ -459,9 +459,11 @@ For example, nice_string("foo\x{100}bar\n") -returns: +returns the string - "foo\x{0100}bar\x0A" + 'foo\x{0100}bar\x0A' + +which is ready to be printed. =head2 Special Cases -- 2.7.4