diff options
author | Chip Salzenberg <chip@atlantic.net> | 1996-12-26 13:07:14 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1996-12-28 06:22:00 +1200 |
commit | 07055b4c536e012d70aa7099a086192fbb14e918 (patch) | |
tree | 3e0a87f4a64a30f336a29f23aba7fd2aac1b1e58 /pp.c | |
parent | 39035d0c756b3e78a63763b830ba26854e6124f8 (diff) | |
download | perl-07055b4c536e012d70aa7099a086192fbb14e918.tar.gz |
Support named closures
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -248,8 +248,11 @@ PP(pp_rv2cv) /* We usually try to add a non-existent subroutine in case of AUTOLOAD. */ /* (But not in defined().) */ CV *cv = sv_2cv(TOPs, &stash, &gv, !(op->op_flags & OPf_SPECIAL)); - - if (!cv) + if (cv) { + if (CvCLONE(cv)) + cv = (CV*)sv_2mortal((SV*)cv_clone(cv)); + } + else cv = (CV*)&sv_undef; SETs((SV*)cv); RETURN; |