[Bast-commits] r9645 - in Class-Accessor-Grouped/trunk: .
lib/Class/Accessor t/lib
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Wed Aug 11 04:21:51 GMT 2010
Author: caelum
Date: 2010-08-11 05:21:51 +0100 (Wed, 11 Aug 2010)
New Revision: 9645
Modified:
Class-Accessor-Grouped/trunk/Changes
Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm
Class-Accessor-Grouped/trunk/t/lib/AccessorGroupsWO.pm
Log:
fix field names with a single quote in them (patch from Jason Plum)
Modified: Class-Accessor-Grouped/trunk/Changes
===================================================================
--- Class-Accessor-Grouped/trunk/Changes 2010-08-11 04:10:04 UTC (rev 9644)
+++ Class-Accessor-Grouped/trunk/Changes 2010-08-11 04:21:51 UTC (rev 9645)
@@ -4,6 +4,7 @@
(recommended by C::XSA author)
- Modified internal cache names to avoid real accessor clashes
- Some micro-optimizations for get_inherited
+ - Fixed field names with a single quote in them (patch from Jason Plum)
0.09003 Fri Apr 23 23:00:19 2010
- use Class::XSAccessor if available for 'simple' accessors, except on
Modified: Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm
===================================================================
--- Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm 2010-08-11 04:10:04 UTC (rev 9644)
+++ Class-Accessor-Grouped/trunk/lib/Class/Accessor/Grouped.pm 2010-08-11 04:21:51 UTC (rev 9645)
@@ -187,6 +187,8 @@
my $set = "set_$group";
my $get = "get_$group";
+ $field =~ s/'/\\'/g;
+
# eval for faster fastiness
my $code = eval "sub {
if(\@_ > 1) {
@@ -221,6 +223,8 @@
my $get = "get_$group";
+ $field =~ s/'/\\'/g;
+
my $code = eval "sub {
if(\@_ > 1) {
my \$caller = caller;
@@ -256,6 +260,8 @@
my $set = "set_$group";
+ $field =~ s/'/\\'/g;
+
my $code = eval "sub {
unless (\@_ > 1) {
my \$caller = caller;
@@ -480,6 +486,7 @@
groditi: Guillermo Roditi <groditi at cpan.org>
ribasushi: Peter Rabbitson <ribasushi at cpan.org>
+Jason Plum <jason.plum at bmmsi.com>
=head1 COPYRIGHT & LICENSE
Modified: Class-Accessor-Grouped/trunk/t/lib/AccessorGroupsWO.pm
===================================================================
--- Class-Accessor-Grouped/trunk/t/lib/AccessorGroupsWO.pm 2010-08-11 04:10:04 UTC (rev 9644)
+++ Class-Accessor-Grouped/trunk/t/lib/AccessorGroupsWO.pm 2010-08-11 04:21:51 UTC (rev 9645)
@@ -5,7 +5,7 @@
__PACKAGE__->mk_group_wo_accessors('single', 'singlefield');
__PACKAGE__->mk_group_wo_accessors('multiple', qw/multiple1 multiple2/);
-__PACKAGE__->mk_group_wo_accessors('listref', [qw/lr1name lr1field/], [qw/lr2name lr2field/]);
+__PACKAGE__->mk_group_wo_accessors('listref', [qw/lr1name lr1;field/], [qw/lr2name lr2'field/]);
sub new {
return bless {}, shift;
More information about the Bast-commits
mailing list