Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 34335
Status: resolved
Priority: 0/
Queue: Moose

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

Bug Information
Severity: Wishlist
Broken in: 0.40
Fixed in: (no value)



Subject: Moose Trap: Don't override new?
I was told on IRC... <autarch> Schwern: also, you don't want to override new(), that breaks an optimization that make_immutable() does <autarch> you could do what you're doing in BUILD instead <autarch> and you should probably make your class immutable Seems like this is going to be a very common mistake for Perl 5 users coming to Moose. Doesn't seem to be documented anywhere obvious. Perhaps a "common traps" manual would be handy, Moose::Trap? In particular the common mistakes and misconceptions made when coming from plain Perl 5 to Moose.
The latest release includes a Moose::Cookbook::Style document which details some of the issues with overriding new and how they are better fixed. This is a document-in-progress though, so if you have additional items to add, commits welcome. - Stevan