Backcompat is tough business :)
[p5sagit/Class-Accessor-Grouped.git] / lib / Class / Accessor / Grouped.pm
index 0bb627b..5f9c300 100644 (file)
@@ -129,6 +129,10 @@ my $add_xs_accessor = sub {
 
         *$fq_meth = Sub::Name::subname($fq_meth, $final_cref);
 
+        # older perls segfault if the cref behind the goto throws
+        # http://rt.perl.org/rt3/Public/Bug/Display.html?id=35878
+        return $final_cref->(@_) if ($] < 5.008009);
+
         goto $final_cref;
     };
 };