#print first letter of Hebrew alphabet (aleph)
my $ch=chr(0x5D0); print STDERR "$ch\n";
####
Debian (Lenny)
system perl (5.10.0)
xterm version: XTerm(235)
bash: GNU bash, version 3.2.39(1)-release (i486-pc-linux-gnu)
####
use strict;
use warnings;
use PerlIO;
use Devel::Peek;
my $ch=chr(0x5D0);
Devel::Peek::Dump($ch);
binmode(STDERR);
print STDERR "layers for STDERR: @{[PerlIO::get_layers(STDERR)]}\n";
print STDERR "$ch\n"; #complains about wide character
binmode(STDERR, ":utf8");
print STDERR "layers for STDERR: @{[PerlIO::get_layers(STDERR)]}\n";
print STDERR "$ch\n"; # no complaints here
print STDERR "I survived :-) !!!\n";
print STDOUT "I really did. I really did.\n";
# End blocks to help verify that STDERR output is being
# truncated, and script is not merely aborting
END { warn "Ah...dead\n"; }
END { warn "I'm dying :-( \n" }
####
SV = PV(0x817c6d0) at 0x8197e90
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
PV = 0x819e970 "\327\220"\0 [UTF8 "\x{5d0}"]
CUR = 2
LEN = 4
layers for STDERR: unix perlio
Wide character in print at Monks/Foo.pm line 916.
\220א
layers for STDERR: unix perlio utf8
\220א
I survived :-) !!!
I really did. I really did.
I'm dying :-(
Ah...dead
####
SV = PV(0x817c6d0) at 0x8197e90
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
PV = 0x819e970 "\327\220"\0 [UTF8 "\x{5d0}"]
CUR = 2
LEN = 4
layers for STDERR: unix perlio
Wide character in print at Monks/Foo.pm line 916.
layers for STDERR: unix perlio utf8
I survived :-) !!!
I really did. I really did.
I'm dying :-(
Ah...dead
####
$ perl myscript.pl
SV = PV(0x817c6d0) at 0x8197e90
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
PV = 0x81a2560 "\327\220"\0 [UTF8 "\x{5d0}"]
CUR = 2
LEN = 4
layers for STDERR: unix perlio
Wide character in print at Monks/Foo.pm line 916.
$
####
$ perl myscript.pl
SV = PV(0x817c6d0) at 0x8197e90
REFCNT = 1
FLAGS = (PADMY,POK,pPOK,UTF8)
PV = 0x819f610 "\327\220"\0 [UTF8 "\x{5d0}"]
CUR = 2
LEN = 4
layers for STDERR: unix perlio utf8
$