From: Peter Rabbitson Date: Thu, 25 Nov 2010 18:03:18 +0000 (+0000) Subject: Minor cleanup and Changes X-Git-Tag: v0.09009~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fdb75175651fb133f1deb2350e02f1555ca8977f;p=p5sagit%2FClass-Accessor-Grouped.git Minor cleanup and Changes --- diff --git a/Changes b/Changes index bb1ce41..b77689a 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Class::Accessor::Grouped. + - Major cleanup and optimization of code (evaled coderef sharing) + - Module can now operate in PurePerl environments with 100% + compatibility (including proper naming of generated coderefs) 0.09008 Sun Oct 11 07:41:56 2010 - Put back a private undocumented method that the DBIC-CDBI compat diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index 8eee167..653ee53 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -500,6 +500,7 @@ BEGIN { local $@; my $err; + $err = eval { require Sub::Name; 1; } ? undef : do { delete $INC{'Sub/Name.pm'}; # because older perls suck $@; @@ -685,6 +686,7 @@ $gen_accessor = sub { my $src = $accessor_maker_cache->{source}{$type}{$group}{$field} ||= $maker_templates->{$type}{pp_code}->($group, $field); + no warnings 'redefine'; local $@ if __CAG_UNSTABLE_DOLLARAT; eval "sub ${fq_name}{$src}";