From: Shawn M Moore Date: Sat, 19 Feb 2011 04:07:37 +0000 (-0500) Subject: Depend less on $ANON_CLASS_PREFIX X-Git-Tag: 2.0001~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4964eb69f3fb68966b6b052a480f8f6b8eebd31d;p=gitmo%2FMoose.git Depend less on $ANON_CLASS_PREFIX --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 43628f2..d33b978 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -464,11 +464,12 @@ sub _remove_generated_metaobjects { my $current_meta = Class::MOP::get_metaclass_by_name($name); return if $current_meta ne $self; - my ($serial_id) = ($name =~ /^$ANON_CLASS_PREFIX(\d+)/o); + my ($first_fragments, $last_fragment) = ($name =~ /^(.*)::(.*)$/); + no strict 'refs'; @{$name . '::ISA'} = (); %{$name . '::'} = (); - delete ${$ANON_CLASS_PREFIX}{$serial_id . '::'}; + delete ${$first_fragments}{$last_fragment . '::'}; Class::MOP::remove_metaclass_by_name($name); }