MX::Singleton. Unfortunately, I cannot really diagnose why I see it
there and not in the MX::Singleton tests, so I can't add a test. I'm
lame.
# the author, after all, nothing is free)
my $source = 'sub {';
$source .= "\n" . 'my $class = shift;';
-
- $source .= "\n" . 'my $existing = do { no strict "refs"; \${"$class\::singleton"}; };';
+
+ $source .= "\n" . 'my $existing = do { no strict "refs"; no warnings "once"; \${"$class\::singleton"}; };';
$source .= "\n" . 'return ${$existing} if ${$existing};';
$source .= "\n" . 'return $class->Moose::Object::new(@_)';