X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FInstance.pm;h=d11b1b6b84f5367b5a68687bff2e08a62b6814c9;hb=80d7d6350a5d1efbd6a399ef724ab8258baff30c;hp=0f13a1273dc8f242efeb1670c4494390eabc0189;hpb=315ed13b7f11bc470c61b9f8c0ebd030e1180579;p=gitmo%2FClass-MOP.git 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 {