comment this up the arseholes
Matt S Trout [Thu, 22 Oct 2009 10:11:44 +0000 (06:11 -0400)]
lib/XML/Tags.pm

index 78cc5d2..40f6926 100644 (file)
@@ -39,6 +39,12 @@ sub _find_target {
 }
 
 sub _set_glob {
+  # stupid insanity. delete anything already there so we disassociated
+  # the *CORE::GLOBAL::glob typeglob. Then the compilation of the eval
+  # revivifies it - i.e. creates us a new glob, which we get a reference
+  # to, which we can then assign to.
+  # doing it without the eval doesn't - it binds to the version in scope
+  # at compile time, which means after a delete you get a nice warm segv.
   delete ${CORE::GLOBAL::}{glob};
   *{eval '\*CORE::GLOBAL::glob'} = $_[0];
 }