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" }