Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Mouse CPAN distribution.

Report information
The Basics
Id: 50422
Status: resolved
Priority: 0/
Queue: Mouse

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.37
Fixed in: (no value)



Subject: Calling new() in a BEGIN block on a class with a BUILD method caused a warning.
{ package Bar; use Mouse; sub BUILD {} } BEGIN { Bar->new; } This results in 'Name "Mouse::Object::BUILD" used only once: possible typo at lib/Mouse/Object.pm line 54.'. Adding "no warnings 'once';" to the do block is one way to handle it. Its broken in both 0.37 and master. --- a/lib/Mouse/Object.pm +++ b/lib/Mouse/Object.pm @@ -51,7 +51,7 @@ sub BUILDALL { return unless $self->can('BUILD'); for my $class (reverse $self->meta->linearized_isa) { - my $build = do{ no strict 'refs'; *{ $class . '::BUILD' }{CODE} } + my $build = do{ no strict 'refs'; no warnings 'once'; *{ $class . '::BUILD' }{CODE} } or next; $self->$build(@_);
Hello, Michael. Thanks. As I fix RT #50421, this issue is also resolved. Regards, -- Goro Fuji (gfx) GFUJI at CPAN.org