projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6506d41
)
Add display() for displaying icky scalars.
author
Jarkko Hietaniemi
<jhi@iki.fi>
Fri, 7 Dec 2001 14:58:06 +0000
(14:58 +0000)
committer
Jarkko Hietaniemi
<jhi@iki.fi>
Fri, 7 Dec 2001 14:58:06 +0000
(14:58 +0000)
p4raw-id: //depot/perl@13513
t/test.pl
patch
|
blob
|
history
diff --git
a/t/test.pl
b/t/test.pl
index
ca4af68
..
ac6bbb7
100644
(file)
--- a/
t/test.pl
+++ b/
t/test.pl
@@
-263,6
+263,12
@@
sub BAILOUT {
}
+# A way to display scalars containing control characters and Unicode.
+sub display {
+ join("", map { $_ > 255 ? sprintf("\\x{%x}", $_) : chr($_) =~ /[[:cntrl:]]/ ? sprintf("\\%03o", $_) : chr($_) } unpack("U*", $_[0]));
+}
+
+
# A somewhat safer version of the sometimes wrong $^X.
BEGIN: {
eval {