Escape any metacharacters in the anon prefix before using it in a regex
[gitmo/Moose.git] / lib / Class / MOP / Package.pm
index d3930ff..92e555e 100644 (file)
@@ -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 {