From: Dave Rolsky Date: Wed, 20 Apr 2011 15:50:48 +0000 (-0500) Subject: Escape any metacharacters in the anon prefix before using it in a regex X-Git-Tag: 2.0100~215 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9520ee8e1c75504698112b729c8f5e637931c8fd;p=gitmo%2FMoose.git Escape any metacharacters in the anon prefix before using it in a regex --- diff --git a/lib/Class/MOP/Package.pm b/lib/Class/MOP/Package.pm index d3930ff..92e555e 100644 --- a/lib/Class/MOP/Package.pm +++ b/lib/Class/MOP/Package.pm @@ -89,7 +89,7 @@ sub create { my $self = shift; no warnings 'uninitialized'; my $prefix = $self->_anon_package_prefix; - $self->name =~ /^$prefix/; + $self->name =~ /^\Q$prefix/; } sub create_anon {