From: Dave Rolsky Date: Sat, 13 Sep 2008 02:39:42 +0000 (+0000) Subject: Fixes to work with latest Moose. X-Git-Tag: 0.12~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Singleton.git;a=commitdiff_plain;h=0272982a342c6c778dba18094bd5e8c28cefc332 Fixes to work with latest Moose. --- diff --git a/lib/MooseX/Singleton/Meta/Method/Constructor.pm b/lib/MooseX/Singleton/Meta/Method/Constructor.pm index 1018a4e..520483a 100644 --- a/lib/MooseX/Singleton/Meta/Method/Constructor.pm +++ b/lib/MooseX/Singleton/Meta/Method/Constructor.pm @@ -13,8 +13,7 @@ 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 = "use Carp qw( confess );\n"; - $source .= 'sub {'; + my $source = 'sub {'; $source .= "\n" . 'my $class = shift;'; $source .= "\n" . 'my $existing = do { no strict "refs"; \${"$class\::singleton"}; };'; @@ -40,6 +39,8 @@ sub initialize_body { my $code; { + my $meta = $self; + # NOTE: # create the nessecary lexicals # to be picked up in the eval