provisional MakeMaker patch for VMS
[p5sagit/p5-mst-13.2.git] / op.c
diff --git a/op.c b/op.c
index c733052..ed199b2 100644 (file)
--- a/op.c
+++ b/op.c
@@ -2043,6 +2043,9 @@ S_my_kid(pTHX_ OP *o, OP *attrs, OP **imopsp)
     } else if (type == OP_RV2SV ||     /* "our" declaration */
               type == OP_RV2AV ||
               type == OP_RV2HV) { /* XXX does this let anything illegal in? */
+      if (cUNOPo->op_first->op_type != OP_GV) { /* MJD 20011224 */
+           yyerror(Perl_form(aTHX_ "Can't declare %s in my", OP_DESC(o)));
+        }
         if (attrs) {
             GV *gv = cGVOPx_gv(cUNOPo->op_first);
             PL_in_my = FALSE;