use Encode qw( encode_utf8 ); my $x = chr(1 << 63); print length($x), "\n"; print length(encode_utf8($x)), "\n"; print "yep\n" if $x gt chr(255); #### Use of code point 0x8000000000000000 is deprecated; the permissible max is 0x7FFFFFFFFFFFFFFF at foo line 2. 1 13 yep