summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1997-01-16 07:24:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-01-16 07:24:00 +1200
commit44a8e56aa037ed0f03f0506f6f85f5ed290c78e1 (patch)
treecb236761929c3161f91de24c86322902758b6efb /op.c
parent8227f81cbd3d53a745747c4247824562383badae (diff)
downloadperl-44a8e56aa037ed0f03f0506f6f85f5ed290c78e1.tar.gz
[inseparable changes from patch from perl5.003_20 to perl5.003_21]
BUILD PROCESS Subject: Make MachTen hints file warn about db-recno failures Date: Wed, 8 Jan 1997 12:07:18 +0100 From: Dominic Dunlop <domo@slipper.ip.lu> Files: hints/machten.sh Msg-ID: <v03010d00aef92fba6aca@[194.51.248.78]> (applied based on p5p patch as commit a4c70ab8da3ec1d87c83e5c617f4550814ec1724) Subject: 5.003_20, FreeBSD 3.0 and minor patch Date: Wed, 8 Jan 1997 14:37:47 +0100 From: Ollivier Robert <roberto@eurocontrol.fr> Files: Configure Msg-ID: <Mutt.19970108143747.roberto@caerdonn.eurocontrol.fr> (applied based on p5p patch as commit 50e0d465254be88fb90ac23584812a529741b4b1) CORE LANGUAGE CHANGES Subject: Fix overloading via inherited autoloaded functions Date: Mon, 13 Jan 1997 05:22:47 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: gv.c lib/overload.pm pod/perldiag.pod t/pragma/overload.t Msg-ID: <199701131022.FAA22830@monk.mps.ohio-state.edu> (applied based on p5p patch as commit a9bc755754f0db5e848e65dfd2e63a96af50ffd4) Subject: Method call fixes: Don't cache in alias, don't skip undef From: Chip Salzenberg <chip@atlantic.net> Files: global.sym gv.c gv.h hv.c op.c pod/perlguts.pod pod/perltoc.pod pp.c pp_ctl.c pp_hot.c proto.h scope.c sv.c t/op/method.t Subject: Formats can be closures From: Chip Salzenberg <chip@atlantic.net> Files: cv.h op.c perly.c perly.c.diff perly.y pp_sys.c sv.h Subject: Quote 'foo' in C<$x{-foo}> From: Chip Salzenberg <chip@atlantic.net> Files: toke.c Subject: Forbid C< x->{y} > and C< x->[0] > under C<strict refs> From: Chip Salzenberg <chip@atlantic.net> Files: op.c pod/perldiag.pod t/pragma/strict-refs Subject: Allow <=> to return undef when operands are not ordered From: Chip Salzenberg <chip@perl.com> Files: MANIFEST pp.c t/op/cmp.t CORE PORTABILITY Subject: Re: Perl 5.003_20: OS/2 patches Date: Fri, 10 Jan 1997 06:02:16 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: hints/os2.sh os2/Changes os2/os2.c os2/os2ish.h pp_sys.c Msg-ID: <199701101102.GAA19051@monk.mps.ohio-state.edu> (applied based on p5p patch as commit 9a3e71f668bd84b1cf53dd3ea10f588d59ecfebb) Subject: VMS patches for _20 Date: Tue, 14 Jan 1997 17:34:43 -0500 (EST) From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU> Files: configpm dosish.h os2/os2ish.h plan9/plan9ish.h proto.h t/pragma/strict.t t/pragma/subs.t t/pragma/warning.t toke.c unixish.h vms/Makefile vms/config.vms vms/descrip.mms vms/genconfig.pl vms/perly_c.vms vms/test.com vms/vmsish.h x2p/a2p.h x2p/str.c private-msgid: <01IE7MGK7ULQ003K5M@hmivax.humgen.upenn.edu> Subject: Irix 6.3 & 6.4 and perl5.003_20 Date: Mon, 13 Jan 1997 17:42:50 -0500 (EST) From: John Stoffel <jfs@fluent.com> Files: MANIFEST hints/irix_6_3.sh hints/irix_6_4.sh Msg-ID: <199701132242.RAA14601@jfs.Fluent.COM> (applied based on p5p patch as commit 8a1e91d771b51ae31eed1ac5944c63934213fb07) Subject: Patch: MachTen hints, Configure Date: Tue, 14 Jan 1997 13:43:13 +0100 From: Dominic Dunlop <domo@slipper.ip.lu> Files: Configure hints/machten.sh private-msgid: <v03010d00af0123a93670@[194.51.248.75]> Subject: Rename aux.sh to aux_3.sh for MS-LOSS From: Chip Salzenberg <chip@atlantic.net> Files: MANIFEST hints/aux_3.sh DOCUMENTATION Subject: Full documentation generation patch Date: Wed, 15 Jan 97 11:16:28 +0100 From: Raphael Manfredi <Raphael_Manfredi@grenoble.hp.com> Files: MANIFEST pod/roffitall pod/rofftoc Msg-ID: <15309.853323388@lyon.grenoble.hp.com> (applied based on p5p patch as commit a3270a1d7469cab9221ab0050a0e6695bd0047d8) Subject: Document use of pos() and /\G/ Date: Mon, 13 Jan 1997 15:13:12 -0500 From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: pod/perlfunc.pod pod/perlnews.pod pod/perlop.pod pod/perlre.pod pod/perltoc.pod pod/perltrap.pod Msg-ID: <199701132013.PAA26606@aatma.engin.umich.edu> (applied based on p5p patch as commit b2a07c1c241ec86f010fc0ea3bfa54c8ec28be90) Subject: Document new closure warnings From: Chip Salzenberg <chip@atlantic.net> Files: op.c pod/perldiag.pod Subject: Misc. doc patches missing in _20 Date: Tue, 07 Jan 1997 22:55:33 -0500 From: Roderick Schertler <roderick@gate.net> Files: pod/perlsub.pod pod/perltoc.pod pod/perlvar.pod Msg-ID: <102.852695733@eeyore.ibcinc.com> (applied based on p5p patch as commit b88f04ff2985d0899964b90ae56789d88f6b353e) LIBRARY AND EXTENSIONS Subject: Localize info about filesystems being case-forgiving From: Chip Salzenberg <chip@atlantic.net> Files: lib/File/Basename.pm pod/checkpods.PL pod/pod2html.PL pod/pod2latex.PL pod/pod2man.PL pod/pod2text.PL utils/c2ph.PL utils/h2ph.PL utils/h2xs.PL utils/perlbug.PL utils/perldoc.PL utils/pl2pm.PL utils/splain.PL x2p/find2perl.PL x2p/s2p.PL Subject: Eliminate warning from C<use overload> From: Chip Salzenberg <chip@atlantic.net> Files: lib/overload.pm OTHER CORE CHANGES Subject: Fix C< eval { my $x; eval '$x' } > From: Chip Salzenberg <chip@atlantic.net> Files: op.c t/op/misc.t Subject: Don't warn if eval '' uses outer func's lexicals From: Chip Salzenberg <chip@atlantic.net> Files: op.c Subject: Avoid memory wastage in wait(); make pidstatus global From: Chip Salzenberg <chip@atlantic.net> Files: global.sym interp.sym perl.c perl.h pp_sys.c Subject: Forbid ++ and -- on readonly values Date: Fri, 10 Jan 1997 19:47:16 -0800 (PST) From: "John Q. Linux" <jql@accessone.com> Files: pp.c pp_hot.c Msg-ID: <Pine.LNX.3.95.970110193330.11249D-100000@jql.accessone.com> (applied based on p5p patch as commit 74c80e585086695d5428ab316ca82fd6931aeabd) Subject: Keep array from dying during foreach(@array) From: Chip Salzenberg <chip@atlantic.net> Files: cop.h pp_ctl.c Subject: Fix C< $a="simple"; split /($a)/o > From: Chip Salzenberg <chip@atlantic.net> Files: pp.c t/op/misc.t Subject: Fix for anon-lists with tied entries coredump Date: Fri, 10 Jan 1997 02:45:11 -0500 From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: pp.c Msg-ID: <199701100745.CAA13057@aatma.engin.umich.edu> (applied based on p5p patch as commit d976ac8220f8890bb7663152c4870f60e8e018c8) Subject: Don't set SVf_PADBUSY on immortal SVs From: Chip Salzenberg <chip@atlantic.net> Files: op.c Subject: Patch for Object subroutines Date: Tue, 7 Jan 1997 20:56:02 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: cop.h Msg-ID: <199701080156.UAA15366@monk.mps.ohio-state.edu> (applied based on p5p patch as commit 174150afa5efdafc0e94a18211d3c9aa06b15cd9) Subject: Use an SVt_PVLV to hold stacked OP pointers when debugging From: Chip Salzenberg <chip@atlantic.net> Files: pp.c pp_hot.c Subject: Undo change that freed large pad vars From: Chip Salzenberg <chip@atlantic.net> Files: scope.c TESTS Subject: UNIVERSAL tests From: Roderick Schertler <roderick@gate.net> Files: MANIFEST t/op/universal.t Subject: Test deletion of array during foreach From: Jarkko Hietaniemi <jhi@alpha.hut.fi> Files: t/op/misc.t UTILITIES Subject: Don't search for pod if path is already valid Date: Wed, 08 Jan 1997 15:25:19 -0800 From: Wayne Scott <wscott@ichips.intel.com> Files: utils/perldoc.PL Msg-ID: <199701082325.PAA04521@pdxlx008.intel.com> (applied based on p5p patch as commit 88f0eda82bb679b4e6445ccb17e18d0781c6a5da) Subject: Yet another perldoc option Date: Thu, 3 Oct 1996 00:00:35 +0200 From: Gisle Aas <aas@aas.no> Files: utils/perldoc.PL Msg-ID: <199610022200.AAA15334@furubotn.sn.no> (applied based on p5p patch as commit a2333f3625faa17fb193cfa25c3d598cb59f105f) Subject: Re: perldoc, temp files, async pagers Date: 07 Jan 1997 22:54:14 -0500 From: Roderick Schertler <roderick@gate.net> Files: utils/perldoc.PL Msg-ID: <pzwwtoom8p.fsf@eeyore.ibcinc.com> (applied based on p5p patch as commit 7c36043de26da560a0f7eb04f36d232762c0092c)
Diffstat (limited to 'op.c')
-rw-r--r--op.c205
1 files changed, 118 insertions, 87 deletions
diff --git a/op.c b/op.c
index 3e3df86a27..34683106dd 100644
--- a/op.c
+++ b/op.c
@@ -212,7 +212,7 @@ pad_findlex(char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix)
SvNVX(sv) = (double)curcop->cop_seq;
SvIVX(sv) = 999999999; /* A ref, intro immediately */
SvFLAGS(sv) |= SVf_FAKE;
- if (CvANON(compcv)) {
+ if (CvANON(compcv) || CvFORMAT(compcv)) {
/* "It's closures all the way down." */
CvCLONE_on(compcv);
if (cv != startcv) {
@@ -224,16 +224,17 @@ pad_findlex(char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix)
CvCLONE_on(bcv);
else {
if (dowarn)
- warn("Value of %s may be unavailable",
+ warn(
+ "Variable \"%s\" may be unavailable",
name);
break;
}
}
}
}
- else {
+ else if (!CvUNIQUE(compcv)) {
if (dowarn && !CvUNIQUE(cv))
- warn("Value of %s will not stay shared", name);
+ warn("Variable \"%s\" will not stay shared", name);
}
}
av_store(comppad, newoff, SvREFCNT_inc(oldsv));
@@ -258,10 +259,14 @@ pad_findlex(char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix)
}
break;
case CXt_EVAL:
- if (cx->blk_eval.old_op_type != OP_ENTEREVAL &&
- cx->blk_eval.old_op_type != OP_ENTERTRY)
- return 0; /* require must have its own scope */
- saweval = i;
+ switch (cx->blk_eval.old_op_type) {
+ case OP_ENTEREVAL:
+ saweval = i;
+ break;
+ case OP_REQUIRE:
+ /* require must have its own scope */
+ return 0;
+ }
break;
case CXt_SUB:
if (!saweval)
@@ -2376,7 +2381,7 @@ OP *op;
cop->cop_line = copline;
copline = NOLINE;
}
- cop->cop_filegv = GvREFCNT_inc(curcop->cop_filegv);
+ cop->cop_filegv = (GV*)SvREFCNT_inc(curcop->cop_filegv);
cop->cop_stash = curstash;
if (perldb && curstash != debstash) {
@@ -2810,6 +2815,7 @@ CV *cv;
CvROOT(cv) = Nullop;
LEAVE;
}
+ CvFLAGS(cv) = 0;
SvREFCNT_dec(CvGV(cv));
CvGV(cv) = Nullgv;
SvREFCNT_dec(CvOUTSIDE(cv));
@@ -2847,13 +2853,13 @@ CV* cv;
(CvANON(cv) ? "ANON"
: (cv == main_cv) ? "MAIN"
: CvUNIQUE(outside) ? "UNIQUE"
- : CvGV(cv) ? GvNAME(CvGV(cv)) : "?mystery?"),
+ : CvGV(cv) ? GvNAME(CvGV(cv)) : "UNDEFINED"),
outside,
(!outside ? "null"
: CvANON(outside) ? "ANON"
: (outside == main_cv) ? "MAIN"
: CvUNIQUE(outside) ? "UNIQUE"
- : CvGV(outside) ? GvNAME(CvGV(outside)) : "?mystery?"));
+ : CvGV(outside) ? GvNAME(CvGV(outside)) : "UNDEFINED"));
for (ix = 1; ix <= AvFILL(pad); ix++) {
if (SvPOK(pname[ix]))
@@ -2894,7 +2900,7 @@ CV* outside;
CvANON_on(cv);
CvFILEGV(cv) = CvFILEGV(proto);
- CvGV(cv) = GvREFCNT_inc(CvGV(proto));
+ CvGV(cv) = (GV*)SvREFCNT_inc(CvGV(proto));
CvSTASH(cv) = CvSTASH(proto);
CvROOT(cv) = CvROOT(proto);
CvSTART(cv) = CvSTART(proto);
@@ -3018,17 +3024,15 @@ OP *op;
OP *proto;
OP *block;
{
+ char *name = op ? SvPVx(cSVOP->op_sv, na) : Nullch;
+ GV *gv = gv_fetchpv(name ? name : "__ANON__", GV_ADDMULTI, SVt_PVCV);
register CV *cv;
- char *name = op ? SvPVx(cSVOP->op_sv, na) : "__ANON__";
- GV* gv = gv_fetchpv(name, GV_ADDMULTI, SVt_PVCV);
- AV* av;
+ AV *av;
I32 ix;
- if (op) {
+ if (op)
SAVEFREEOP(op);
- sub_generation++;
- }
- if (cv = GvCV(gv)) {
+ if (cv = (name ? GvCV(gv) : Nullcv)) {
if (GvCVGEN(gv)) {
/* just a cached method */
SvREFCNT_dec(cv);
@@ -3045,9 +3049,8 @@ OP *block;
SvPOK(cv) ? SvPV((SV*)cv,na) : "none",
p ? p : "none");
}
- if ((const_sv || dowarn) && strNE(name, "BEGIN")) {
+ if (const_sv || dowarn) {
line_t oldline = curcop->cop_line;
-
curcop->cop_line = copline;
warn(const_sv ? "Constant subroutine %s redefined"
: "Subroutine %s redefined",name);
@@ -3059,7 +3062,7 @@ OP *block;
}
if (cv) { /* must reuse cv if autoloaded */
cv_undef(cv);
- CvFLAGS(cv) = (CvFLAGS(cv)&~CVf_CLONE) | (CvFLAGS(compcv)&CVf_CLONE);
+ CvFLAGS(cv) = CvFLAGS(compcv);
CvOUTSIDE(cv) = CvOUTSIDE(compcv);
CvOUTSIDE(compcv) = 0;
CvPADLIST(cv) = CvPADLIST(compcv);
@@ -3070,11 +3073,14 @@ OP *block;
}
else {
cv = compcv;
+ if (name) {
+ GvCV(gv) = cv;
+ GvCVGEN(gv) = 0;
+ sub_generation++;
+ }
}
- GvCV(gv) = cv;
- GvCVGEN(gv) = 0;
+ CvGV(cv) = (GV*)SvREFCNT_inc(gv);
CvFILEGV(cv) = curcop->cop_filegv;
- CvGV(cv) = GvREFCNT_inc(gv);
CvSTASH(cv) = curstash;
if (proto) {
@@ -3088,7 +3094,6 @@ OP *block;
block = Nullop;
}
if (!block) {
- CvROOT(cv) = 0;
copline = NOLINE;
LEAVE_SCOPE(floor);
return cv;
@@ -3100,7 +3105,7 @@ OP *block;
AvFLAGS(av) = AVf_REIFY;
for (ix = AvFILL(comppad); ix > 0; ix--) {
- if (!SvPADMY(curpad[ix]))
+ if (!SvPADMY(curpad[ix]) && !SvIMMORTAL(curpad[ix]))
SvPADTMP_on(curpad[ix]);
}
@@ -3112,9 +3117,39 @@ OP *block;
CvROOT(cv)->op_next = 0;
peep(CvSTART(cv));
- if (op) {
- char *s = strrchr(name,':');
- if (s)
+ if (name) {
+ char *s;
+
+ if (perldb && curstash != debstash) {
+ SV *sv;
+ SV *tmpstr = sv_newmortal();
+ static GV *db_postponed;
+ CV *cv;
+ HV *hv;
+
+ sprintf(buf, "%s:%ld",
+ SvPVX(GvSV(curcop->cop_filegv)), (long)subline);
+ sv = newSVpv(buf,0);
+ sv_catpv(sv,"-");
+ sprintf(buf,"%ld",(long)curcop->cop_line);
+ sv_catpv(sv,buf);
+ gv_efullname3(tmpstr, gv, Nullch);
+ hv_store(GvHV(DBsub), SvPVX(tmpstr), SvCUR(tmpstr), sv, 0);
+ if (!db_postponed) {
+ db_postponed = gv_fetchpv("DB::postponed", TRUE, SVt_PVHV);
+ }
+ hv = GvHVn(db_postponed);
+ if (HvFILL(hv) >= 0 && hv_exists(hv, SvPVX(tmpstr), SvCUR(tmpstr))
+ && (cv = GvCV(db_postponed))) {
+ dSP;
+ PUSHMARK(sp);
+ XPUSHs(tmpstr);
+ PUTBACK;
+ perl_call_sv((SV*)cv, G_DISCARD);
+ }
+ }
+
+ if ((s = strrchr(name,':')))
s++;
else
s = name;
@@ -3145,37 +3180,6 @@ OP *block;
}
}
- if (perldb && curstash != debstash) {
- SV *sv;
- SV *tmpstr = sv_newmortal();
- static GV *db_postponed;
- CV *cv;
- HV *hv;
-
- sprintf(buf,"%s:%ld",SvPVX(GvSV(curcop->cop_filegv)), (long)subline);
- sv = newSVpv(buf,0);
- sv_catpv(sv,"-");
- sprintf(buf,"%ld",(long)curcop->cop_line);
- sv_catpv(sv,buf);
- gv_efullname3(tmpstr, gv, Nullch);
- hv_store(GvHV(DBsub), SvPVX(tmpstr), SvCUR(tmpstr), sv, 0);
- if (!db_postponed) {
- db_postponed = gv_fetchpv("DB::postponed", TRUE, SVt_PVHV);
- }
- hv = GvHVn(db_postponed);
- if (HvFILL(hv) >= 0 && hv_exists(hv, SvPVX(tmpstr), SvCUR(tmpstr))
- && (cv = GvCV(db_postponed))) {
- dSP;
- PUSHMARK(sp);
- XPUSHs(tmpstr);
- PUTBACK;
- perl_call_sv((SV*)cv, G_DISCARD);
- }
- }
-
- if (!op)
- GvCV(gv) = 0; /* Will remember in SVOP instead. */
-
copline = NOLINE;
LEAVE_SCOPE(floor);
return cv;
@@ -3202,18 +3206,19 @@ char *name;
void (*subaddr) _((CV*));
char *filename;
{
+ GV *gv = gv_fetchpv(name ? name : "__ANON__", GV_ADDMULTI, SVt_PVCV);
register CV *cv;
- GV *gv = gv_fetchpv((name ? name : "__ANON__"), GV_ADDMULTI, SVt_PVCV);
-
- if (name)
- sub_generation++;
- if (cv = GvCV(gv)) {
- if (GvCVGEN(gv))
- cv = 0; /* just a cached method */
- else if (CvROOT(cv) || CvXSUB(cv)) { /* already defined? */
+
+ if (cv = (name ? GvCV(gv) : Nullcv)) {
+ if (GvCVGEN(gv)) {
+ /* just a cached method */
+ SvREFCNT_dec(cv);
+ cv = 0;
+ }
+ else if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) {
+ /* already defined (or promised) */
if (dowarn) {
line_t oldline = curcop->cop_line;
-
curcop->cop_line = copline;
warn("Subroutine %s redefined",name);
curcop->cop_line = oldline;
@@ -3222,19 +3227,22 @@ char *filename;
cv = 0;
}
}
- if (cv) { /* must reuse cv if autoloaded */
- assert(SvREFCNT(CvGV(cv)) > 1);
- SvREFCNT_dec(CvGV(cv));
- }
+
+ if (cv) /* must reuse cv if autoloaded */
+ cv_undef(cv);
else {
cv = (CV*)NEWSV(1105,0);
sv_upgrade((SV *)cv, SVt_PVCV);
+ if (name) {
+ GvCV(gv) = cv;
+ GvCVGEN(gv) = 0;
+ sub_generation++;
+ }
}
- GvCV(gv) = cv;
- CvGV(cv) = GvREFCNT_inc(gv);
- GvCVGEN(gv) = 0;
+ CvGV(cv) = (GV*)SvREFCNT_inc(gv);
CvFILEGV(cv) = gv_fetchfile(filename);
CvXSUB(cv) = subaddr;
+
if (name) {
char *s = strrchr(name,':');
if (s)
@@ -3244,19 +3252,20 @@ char *filename;
if (strEQ(s, "BEGIN")) {
if (!beginav)
beginav = newAV();
- av_push(beginav, SvREFCNT_inc(gv));
+ av_push(beginav, (SV *)cv);
+ GvCV(gv) = 0;
}
else if (strEQ(s, "END")) {
if (!endav)
endav = newAV();
av_unshift(endav, 1);
- av_store(endav, 0, SvREFCNT_inc(gv));
+ av_store(endav, 0, (SV *)cv);
+ GvCV(gv) = 0;
}
}
- else {
- GvCV(gv) = 0; /* Will remember elsewhere instead. */
+ else
CvANON_on(cv);
- }
+
return cv;
}
@@ -3289,11 +3298,11 @@ OP *block;
}
cv = compcv;
GvFORM(gv) = cv;
- CvGV(cv) = GvREFCNT_inc(gv);
+ CvGV(cv) = (GV*)SvREFCNT_inc(gv);
CvFILEGV(cv) = curcop->cop_filegv;
for (ix = AvFILL(comppad); ix > 0; ix--) {
- if (!SvPADMY(curpad[ix]))
+ if (!SvPADMY(curpad[ix]) && !SvIMMORTAL(curpad[ix]))
SvPADTMP_on(curpad[ix]);
}
@@ -3635,9 +3644,31 @@ register OP *op;
op->op_private |= (hints & HINT_STRICT_REFS);
if (kid->op_type == OP_CONST) {
- int iscv = (op->op_type==OP_RV2CV)*2;
- GV *gv = 0;
+ char *name;
+ int iscv;
+ GV *gv;
+
+ name = SvPV(kid->op_sv, na);
+ if ((hints & HINT_STRICT_REFS) && (kid->op_private & OPpCONST_BARE)) {
+ char *badthing = Nullch;
+ switch (op->op_type) {
+ case OP_RV2SV:
+ badthing = "a SCALAR";
+ break;
+ case OP_RV2AV:
+ badthing = "an ARRAY";
+ break;
+ case OP_RV2HV:
+ badthing = "a HASH";
+ break;
+ }
+ if (badthing)
+ croak(
+ "Can't use bareword (\"%s\") as %s ref while \"strict refs\" in use",
+ name, badthing);
+ }
kid->op_type = OP_GV;
+ iscv = (op->op_type == OP_RV2CV) * 2;
for (gv = 0; !gv; iscv++) {
/*
* This is a little tricky. We only want to add the symbol if we
@@ -3647,7 +3678,7 @@ register OP *op;
* or we get possible typo warnings. OPpCONST_ENTERED says
* whether the lexer already added THIS instance of this symbol.
*/
- gv = gv_fetchpv(SvPVx(kid->op_sv, na),
+ gv = gv_fetchpv(name,
iscv | !(kid->op_private & OPpCONST_ENTERED),
iscv
? SVt_PVCV