diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-05 20:38:30 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-05 20:38:30 +0000 |
commit | d0551e7362dcfdf0d37c8900b7c6372851ee7f19 (patch) | |
tree | 14278937c590343a268f9d4af1bd07ef377af5bd | |
parent | 1ccffcf53e06b538ce52bce400c2322285291267 (diff) | |
download | perl-d0551e7362dcfdf0d37c8900b7c6372851ee7f19.tar.gz |
[perl #21839] perluniintro.pod: nice_string() doesn't escape
literal escape chars -- use Sadahiro-san's fix(es).
p4raw-id: //depot/perl@19148
-rw-r--r-- | pod/perluniintro.pod | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pod/perluniintro.pod b/pod/perluniintro.pod index f18cdeeb80..feee902a7f 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 |