From: Dave Rolsky Date: Mon, 16 Mar 2009 20:53:51 +0000 (-0500) Subject: add a warning for the deprecated Class::MOP::Instance->bless_intsance_structure method X-Git-Tag: 0.80_01~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cf11901eebe04a2999c1d43c484c2bcb31023bad;p=gitmo%2FClass-MOP.git add a warning for the deprecated Class::MOP::Instance->bless_intsance_structure method --- diff --git a/examples/ArrayBasedStorage.pod b/examples/ArrayBasedStorage.pod index bff9baa..5c0369c 100644 --- a/examples/ArrayBasedStorage.pod +++ b/examples/ArrayBasedStorage.pod @@ -23,7 +23,7 @@ sub new { sub create_instance { my $self = shift; - my $instance = $self->bless_instance_structure([]); + my $instance = bless [], $self->_class_name; $self->initialize_all_slots($instance); return $instance; } diff --git a/examples/InsideOutClass.pod b/examples/InsideOutClass.pod index 5f94a25..b69c10f 100644 --- a/examples/InsideOutClass.pod +++ b/examples/InsideOutClass.pod @@ -102,7 +102,7 @@ use base 'Class::MOP::Instance'; sub create_instance { my ($self, $class) = @_; - $self->bless_instance_structure(\(my $instance)); + bless \(my $instance), $self->_class_name; } sub get_slot_value { diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index 16dd6e0..700ec75 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -75,6 +75,9 @@ sub create_instance { # for compatibility sub bless_instance_structure { + warn 'The bless_instance_structure method is deprecated.' + . " It will be removed in a future release.\n"; + my ($self, $instance_structure) = @_; bless $instance_structure, $self->_class_name; }