use the right glob name here
Jesse Luehrs [Sat, 10 Dec 2011 04:46:36 +0000 (22:46 -0600)]
XS.xs

diff --git a/XS.xs b/XS.xs
index 87802d8..bfc23a2 100644 (file)
--- a/XS.xs
+++ b/XS.xs
@@ -582,8 +582,11 @@ add_symbol(self, variable, initial=NULL, ...)
         glob = (GV*)HeVAL(entry);
     }
     else {
+        char *varname_pv;
+        STRLEN varname_len;
         glob = (GV*)newSV(0);
-        gv_init(glob, namespace, "ANON", 4, 1);
+        varname_pv = SvPV(variable.name, varname_len);
+        gv_init(glob, namespace, varname_pv, varname_len, 1);
         if (!hv_store_ent(namespace, variable.name, (SV*)glob, 0)) {
             croak("hv_store failed");
         }