diff options
author | Josh ben Jore <jjore@cpan.org> | 2009-09-23 15:35:14 -0700 |
---|---|---|
committer | Josh ben Jore <jjore@cpan.org> | 2009-09-28 16:40:00 -0700 |
commit | 5341b2b7ab11bc31f63ac7a675e74106418d0661 (patch) | |
tree | 0e6469b5c24e455da55241aad50dab8c8cac44e3 /op.c | |
parent | 906bad61c3bd0dd3a56a226b2981e4d14d5e71c9 (diff) | |
download | perl-5341b2b7ab11bc31f63ac7a675e74106418d0661.tar.gz |
Fix when( scalar ... ) bug
looks_like_bool should look past scalar(). Prior to this fix, saying
scalar() caused the when() argument to be /not/ a boolean even if it
reasonably was. Perhaps something like: when( scalar /$re/ ). I don't
know any natural way someone is doing to use when(scalar ...) but it
certainly seems like it was mistakenly left out.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -5194,6 +5194,10 @@ S_looks_like_bool(pTHX_ const OP *o) o->op_flags & OPf_KIDS && looks_like_bool(cUNOPo->op_first)); + case OP_SCALAR: + return looks_like_bool(cUNOPo->op_first); + + case OP_ENTERSUB: case OP_NOT: case OP_XOR: |