I'm not sure what changed here but we need to get confess into scope
[gitmo/MooseX-Singleton.git] / lib / MooseX / Singleton / Meta / Method / Constructor.pm
index b3ec6a8..1018a4e 100644 (file)
@@ -13,7 +13,8 @@ sub initialize_body {
     # of the possible use cases (even if it
     # requires some adaption on the part of
     # the author, after all, nothing is free)
-    my $source = 'sub {';
+    my $source = "use Carp qw( confess );\n";
+    $source .= 'sub {';
     $source .= "\n" . 'my $class = shift;';
 
     $source .= "\n" . 'my $existing = do { no strict "refs"; \${"$class\::singleton"}; };';