From: Dave Rolsky Date: Fri, 5 Sep 2008 13:16:38 +0000 (+0000) Subject: I'm not sure what changed here but we need to get confess into scope X-Git-Tag: 0.11~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e5eff87ae006b51bb675f990c000656bcc6c6426;p=gitmo%2FMooseX-Singleton.git I'm not sure what changed here but we need to get confess into scope or else the constructor blows up. This may need to change again with the next release. --- diff --git a/lib/MooseX/Singleton/Meta/Method/Constructor.pm b/lib/MooseX/Singleton/Meta/Method/Constructor.pm index b3ec6a8..1018a4e 100644 --- a/lib/MooseX/Singleton/Meta/Method/Constructor.pm +++ b/lib/MooseX/Singleton/Meta/Method/Constructor.pm @@ -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"}; };';