diff --git a/pp.c b/pp.c index 910e53cf7a2a..549faef4d076 100644 --- a/pp.c +++ b/pp.c @@ -3604,7 +3604,7 @@ PP_wrapped(pp_substr, } if ((len_sv = POPs)) { len_iv = SvIV(len_sv); - len_is_uv = len_iv ? SvIOK_UV(len_sv) : 1; + len_is_uv = len_iv == 0 || SvIOK_UV(len_sv); } else num_args--; }