From: gfx Date: Thu, 13 Aug 2009 06:57:11 +0000 (+0900) Subject: Fix too much quotemeta in Instance metaclass X-Git-Tag: 0.92~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=80d7d6350a5d1efbd6a399ef724ab8258baff30c;p=gitmo%2FClass-MOP.git Fix too much quotemeta in Instance metaclass --- diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index 0f13a12..d11b1b6 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -181,7 +181,8 @@ sub inline_create_instance { sub inline_slot_access { my ($self, $instance, $slot_name) = @_; - sprintf q[%s->{'%s'}], $instance, quotemeta($slot_name); + $slot_name =~ s/(['\\])/\\$1/g; # In '', only "'" and "\\" are meta characters. + sprintf q[%s->{'%s'}], $instance, $slot_name; } sub inline_get_slot_value {