autovivify open($fh[0],...) properly
Gurusamy Sarathy [Mon, 20 Mar 2000 16:27:13 +0000 (16:27 +0000)]
p4raw-id: //depot/perl@5836

op.c
pp.c

diff --git a/op.c b/op.c
index 0cdeb92..3d55126 100644 (file)
--- a/op.c
+++ b/op.c
@@ -5520,6 +5520,13 @@ Perl_ck_fun(pTHX_ OP *o)
                                name = GvNAME(gv);
                                len = GvNAMELEN(gv);
                            }
+                           else if (kid->op_type == OP_AELEM
+                                    || kid->op_type == OP_HELEM)
+                           {
+                               name = "__ANONIO__";
+                               len = 10;
+                               mod(kid,type);
+                           }
                            if (name) {
                                SV *namesv;
                                targ = pad_alloc(OP_RV2GV, SVs_PADTMP);
diff --git a/pp.c b/pp.c
index 30476bd..a59664e 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -205,7 +205,7 @@ PP(pp_rv2gv)
                if (SvROK(sv))
                    goto wasref;
            }
-           if (!SvOK(sv)) {
+           if (!SvOK(sv) && sv != &PL_sv_undef) {
                /* If this is a 'my' scalar and flag is set then vivify 
                 * NI-S 1999/05/07
                 */