cleanup require usage so we don't trample on $@ and tweak the DEMOLISH code slightly
[gitmo/Role-Tiny.git] / lib / Method / Generate / Constructor.pm
index 9190ea5..e4f7b1f 100644 (file)
@@ -54,7 +54,7 @@ sub generate_method {
   $body .= '    my $new = '.$self->construction_string.";\n";
   $body .= $self->_assign_new($spec);
   if ($into->can('BUILD')) {
-    require Method::Generate::BuildAll;
+    { local $@; require Method::Generate::BuildAll; }
     $body .= Method::Generate::BuildAll->new->buildall_body_for(
       $into, '$new', '$args'
     );