Typeglobs and references can change their UTF8ness upon string-
ification.
SETi(len);
} else if (SvOK(sv)) {
/* Neither magic nor overloaded. */
- if (DO_UTF8(sv))
+ if (!IN_BYTES)
SETi(sv_len_utf8(sv));
else
SETi(sv_len(sv));
@INC = '../lib';
}
-plan (tests => 38);
+plan (tests => 39);
print "not " unless length("") == 0;
print "ok 1\n";
eval ' sub { length my @forecasts } ';
}
+# length could be fooled by UTF8ness of non-magical variables changing with
+# stringification.
+my $ref = [];
+bless $ref, "\x{100}";
+is length $ref, length "$ref", 'length on reference blessed to utf8 class';
+
is($warnings, 0, "There were no other warnings");