summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-10-22 12:00:23 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-10-22 12:00:23 +0000
commitf558d5af046340f7a95617ab54ffef1ba978891c (patch)
tree9623fdf76fe2eda508908025ec02863883a91bd0 /toke.c
parent1892e65414ec63f83cc8b4e9d6f8396cb10d7d22 (diff)
downloadperl-f558d5af046340f7a95617ab54ffef1ba978891c.tar.gz
Integrate changes #12549 and #12550 from maintperl;
readline() doesn't work with our variables; it confuses them with my variables (change#4227 was incomplete) p4raw-link: @12549 on //depot/maint-5.6/perl: 5e948b4e169e88676c1f1359a0a62d670c4b4221 p4raw-link: @4227 on //depot/perl: 77ca0c92d2c0e47301d906d355d9ab3afb6f6bcb p4raw-id: //depot/perl@12561 p4raw-integrated: from //depot/maint-5.6/perl@12558 'copy in' t/base/rs.t (@8152..) 'edit in' toke.c (@12549..)
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/toke.c b/toke.c
index af117bcf92..223cb76bd9 100644
--- a/toke.c
+++ b/toke.c
@@ -6646,12 +6646,29 @@ S_scan_inputsymbol(pTHX_ char *start)
add symbol table ops
*/
if ((tmp = pad_findmy(d)) != NOT_IN_PAD) {
- OP *o = newOP(OP_PADSV, 0);
- o->op_targ = tmp;
- PL_lex_op = (OP*)newUNOP(OP_READLINE, 0, o);
+ SV *namesv = AvARRAY(PL_comppad_name)[tmp];
+ if (SvFLAGS(namesv) & SVpad_OUR) {
+ SV *sym = sv_2mortal(newSVpv(HvNAME(GvSTASH(namesv)),0));
+ sv_catpvn(sym, "::", 2);
+ sv_catpv(sym, d+1);
+ d = SvPVX(sym);
+ goto intro_sym;
+ }
+ else {
+ OP *o = newOP(OP_PADSV, 0);
+ o->op_targ = tmp;
+ PL_lex_op = (OP*)newUNOP(OP_READLINE, 0, o);
+ }
}
else {
- GV *gv = gv_fetchpv(d+1,TRUE, SVt_PV);
+ GV *gv;
+ ++d;
+intro_sym:
+ gv = gv_fetchpv(d,
+ (PL_in_eval
+ ? (GV_ADDMULTI | GV_ADDINEVAL)
+ : TRUE),
+ SVt_PV);
PL_lex_op = (OP*)newUNOP(OP_READLINE, 0,
newUNOP(OP_RV2SV, 0,
newGVOP(OP_GV, 0, gv)));