WARNING: this program MUST be in a file in UTF-8 mode, NOT Latin1
use utf8;
use warnings;
my $msg = "";
$SIG{__WARN__} = sub { $msg = shift };
sub SKRÈÈÈ;
my $victim = sprintf("%d", *SKRÈÈÈ);
$msg =~ m/Argument "\*main::SKR\\x\{c8}\\x\{c8}\\x\{c8}" isn.t numeric in sprintf/ and print "ok\n";
binmode STDOUT, ":utf8";
print "got=$msg\n"
when run with pure perl, you get:
ok
got=Argument "*main::SKR\x{c8}\x{c8}\x{c8}" isn't numeric in sprintf at foo.pl line 9.
when run with B::C, you get:
got=Argument "*main::SKRÈÈÈ" isn't numeric in sprintf at foo.pl line 9.
WARNING: this program MUST be in a file in UTF-8 mode, NOT Latin1
when run with pure perl, you get:
when run with B::C, you get: