From: Chris Prather Date: Wed, 12 Aug 2009 03:12:43 +0000 (-0400) Subject: add warning for $obj->new X-Git-Tag: 0.90~32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a759250724ad6270b37331f4f12b1b4b1a061ae9;p=gitmo%2FMoose.git add warning for $obj->new --- diff --git a/lib/Moose/Object.pm b/lib/Moose/Object.pm index 8187642..940bb6f 100644 --- a/lib/Moose/Object.pm +++ b/lib/Moose/Object.pm @@ -18,7 +18,10 @@ our $AUTHORITY = 'cpan:STEVAN'; sub new { my $class = shift; - + + Carp::cluck 'Calling new() on an instance is deprecated,' + . ' please use (blessed $obj)->new' if blessed $class; + my $params = $class->BUILDARGS(@_); # We want to support passing $self->new, but initialize