#!./perl
-print "1..190\n";
+print "1..192\n";
#P = start of string Q = start of substr R = end of substr S = end of string
substr($a, -1) &= chr(0xfeff);
ok 190, $a eq "\xbf";
}
+
+# [perl #34976] incorrect caching of utf8 substr length
+{
+ my $a = "abcd\x{100}";
+ ok 191, substr($a,1,2) eq 'bc';
+ ok 192, substr($a,1,1) eq 'b';
+}