diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-07-01 12:28:04 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-07-01 12:28:04 +0200 |
commit | fb51372e8e462d7f3320e8a1b91a913f976aae12 (patch) | |
tree | a6123ddad0e335ee368d524bcad78e628f526803 /pp_ctl.c | |
parent | 9b5b006ca2dcfa112f22578f899526bce7d5e411 (diff) | |
download | perl-fb51372e8e462d7f3320e8a1b91a913f976aae12.tar.gz |
Make C<undef ~~ 0> and C<undef ~~ ""> not match (like in 5.10.0)
This makes ~~ commutative with regard to undef, and fixes an
inconsistency, since C<undef ~~ [0]> was not matching, and ~~
should be distributive in this case.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -4393,6 +4393,10 @@ S_do_smartmatch(pTHX_ HV *seen_this, HV *seen_other) SP -= 2; goto sm_any_scalar; } + else if (!SvOK(d)) { + /* undef ~~ scalar ; we already know that the scalar is SvOK */ + RETPUSHNO; + } else sm_any_scalar: if (SvNIOK(e) || (SvPOK(e) && looks_like_number(e) && SvNIOK(d))) { |