in reply to Re^2: Moose: return null object
in thread Moose: return null object
Yer not suppose to use your own "new"
That's an overstatement.
No errors, however, the object returned is still a hash ref
Sure, because you told Moose to use its own new instead of yours.
package Module; use Mouse; sub new { return undef } __PACKAGE__->meta->make_immutable( inline_constructor => 0 ); print __PACKAGE__->new();
I think it used to warn when new existed and you inlined the constructor. It really should. (Upd: OH! Moose does warn, it's Mouse that doesn't. Mouse-- lamprecht++ )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Moose: return null object
by halfcountplus (Hermit) on Apr 18, 2011 at 17:11 UTC |