summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorSimon Cozens <simon@netthink.co.uk>2000-12-27 02:30:03 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-28 22:59:16 +0000
commitd32f2495b04e916e41d6514e2a6126c7223b49c9 (patch)
treed2bc308597a2f631eff0c83a1337d1f1582a352d /pp.c
parentf72d64f00dcc19f7e88984b22d52340f7101e18f (diff)
downloadperl-d32f2495b04e916e41d6514e2a6126c7223b49c9.tar.gz
lvalue AUTOLOAD. No, really.
Message-ID: <20001227023003.A7677@deep-dark-truthful-mirror.perlhacker.org> p4raw-id: //depot/perl@8243
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 2cb463ee9e..8914104c22 100644
--- a/pp.c
+++ b/pp.c
@@ -385,8 +385,12 @@ PP(pp_rv2cv)
if (cv) {
if (CvCLONE(cv))
cv = (CV*)sv_2mortal((SV*)cv_clone(cv));
- if ((PL_op->op_private & OPpLVAL_INTRO) && !CvLVALUE(cv))
- DIE(aTHX_ "Can't modify non-lvalue subroutine call");
+ if ((PL_op->op_private & OPpLVAL_INTRO)) {
+ if (gv && GvCV(gv) == cv && (gv = gv_autoload4(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), FALSE)))
+ cv = GvCV(gv);
+ if (!CvLVALUE(cv))
+ DIE(aTHX_ "Can't modify non-lvalue subroutine call");
+ }
}
else
cv = (CV*)&PL_sv_undef;