diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-21 01:45:51 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-01-21 01:45:51 +0000 |
commit | afebc493229293927e6b724b2070ac810a813a28 (patch) | |
tree | 8620ca918ff123d33ce69aa0bba75bc95433d088 /pp.c | |
parent | b1a9ed4a50dbd0c26cd6f3422bdf7a12d75292f7 (diff) | |
download | perl-afebc493229293927e6b724b2070ac810a813a28.tar.gz |
support for C<exists &func> (from Spider Boardman)
p4raw-id: //depot/perl@4827
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -2701,8 +2701,22 @@ PP(pp_delete) PP(pp_exists) { djSP; - SV *tmpsv = POPs; - HV *hv = (HV*)POPs; + SV *tmpsv; + HV *hv; + + if (PL_op->op_private & OPpEXISTS_SUB) { + GV *gv; + CV *cv; + SV *sv = POPs; + cv = sv_2cv(sv, &hv, &gv, FALSE); + if (cv) + RETPUSHYES; + if (gv && isGV(gv) && GvCV(gv) && !GvCVGEN(gv)) + RETPUSHYES; + RETPUSHNO; + } + tmpsv = POPs; + hv = (HV*)POPs; if (SvTYPE(hv) == SVt_PVHV) { if (hv_exists_ent(hv, tmpsv, 0)) RETPUSHYES; |