From: Dave Rolsky Date: Sun, 13 Sep 2009 15:40:35 +0000 (-0500) Subject: Changes and Delta for $object->new deprecation X-Git-Tag: 0.90~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3f5ff7d097203b6bbddea94dbdc6aa667fd04686;p=gitmo%2FMoose.git Changes and Delta for $object->new deprecation --- diff --git a/Changes b/Changes index 30e47fd..f42f2bd 100644 --- a/Changes +++ b/Changes @@ -21,6 +21,8 @@ Next Devel::GlobalDestruction::in_global_destruction. - These two fixes address some of RT #48271, reported by Zefram. - This is all now documented in Moose::Manual::Construction. + - Calling $object->new() is now deprecated. A warning will be + issued. (perigrin) * Moose::Meta::Role - Add more hooks to customize how roles are applied. diff --git a/lib/Moose/Manual/Delta.pod b/lib/Moose/Manual/Delta.pod index 6c12b9c..f32dde9 100644 --- a/lib/Moose/Manual/Delta.pod +++ b/lib/Moose/Manual/Delta.pod @@ -24,6 +24,16 @@ send us a patch. See L for details. +=item Calling $object->new() is deprecated + +Moose has long supported this, but it's never really been documented, and we +don't think this is a good practice. If you want to construct an object from +an existing object, you should provide some sort of alternate constructor like +C<< $object->clone >>. + +Calling C<< $object->new >> now issues a warning, and will be an error in a +future release. + =back =head1 Version 0.89_02