Re: localising hash element by variable
[p5sagit/p5-mst-13.2.git] / mg.c
diff --git a/mg.c b/mg.c
index 655af2b..77ae021 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1519,6 +1519,11 @@ Perl_magic_setisa(pTHX_ SV *sv, MAGIC *mg)
     /* Bail out if destruction is going on */
     if(PL_dirty) return 0;
 
+    /* XXX Once it's possible, we need to
+       detect that our @ISA is aliased in
+       other stashes, and act on the stashes
+       of all of the aliases */
+
     /* The first case occurs via setisa,
        the second via setisa_elem, which
        calls this same magic */
@@ -2242,11 +2247,12 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
       goto setparen;
     case '1': case '2': case '3': case '4':
     case '5': case '6': case '7': case '8': case '9':
+      paren = atoi(mg->mg_ptr);
       setparen:
-           if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
+       if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
             CALLREG_NUMBUF_STORE((REGEXP * const)rx,paren,sv);
             break;
-           } else {
+       } else {
             /* Croak with a READONLY error when a numbered match var is
              * set without a previous pattern match. Unless it's C<local $1>
              */