summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-01-21 01:45:51 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-01-21 01:45:51 +0000
commitafebc493229293927e6b724b2070ac810a813a28 (patch)
tree8620ca918ff123d33ce69aa0bba75bc95433d088 /pp.c
parentb1a9ed4a50dbd0c26cd6f3422bdf7a12d75292f7 (diff)
downloadperl-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.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index c3874337e3..267da99747 100644
--- a/pp.c
+++ b/pp.c
@@ -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;