diff options
author | Brent Dax <brentdax@cpan.org> | 2002-07-25 22:41:52 -0700 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-05 15:04:54 +0000 |
commit | c963b151157dab5813a32fc6004b63916ad155e8 (patch) | |
tree | e88a528a16616c2f136f31b2c37b08e237b08799 /pp_hot.c | |
parent | d73f34fb2db5664941bbe71b34c335b0ae3b50b3 (diff) | |
download | perl-c963b151157dab5813a32fc6004b63916ad155e8.tar.gz |
Defined-or patch (cleaned up)
From: "Brent Dax" <brentdax@cpan.org>
Message-id: <000001c234a1$d1ca72c0$6501a8c0@deepblue>
p4raw-id: //depot/perl@17682
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -320,6 +320,42 @@ PP(pp_or) } } +PP(pp_dor) +{ + /* Most of this is lifted straight from pp_defined */ + dSP; + register SV* sv; + + sv = TOPs; + if (!sv || !SvANY(sv)) { + --SP; + RETURNOP(cLOGOP->op_other); + } + + switch (SvTYPE(sv)) { + case SVt_PVAV: + if (AvMAX(sv) >= 0 || SvGMAGICAL(sv) || (SvRMAGICAL(sv) && mg_find(sv, PERL_MAGIC_tied))) + RETURN; + break; + case SVt_PVHV: + if (HvARRAY(sv) || SvGMAGICAL(sv) || (SvRMAGICAL(sv) && mg_find(sv, PERL_MAGIC_tied))) + RETURN; + break; + case SVt_PVCV: + if (CvROOT(sv) || CvXSUB(sv)) + RETURN; + break; + default: + if (SvGMAGICAL(sv)) + mg_get(sv); + if (SvOK(sv)) + RETURN; + } + + --SP; + RETURNOP(cLOGOP->op_other); +} + PP(pp_add) { dSP; dATARGET; bool useleft; tryAMAGICbin(add,opASSIGN); |