Subject: | regexp to check for nasty class names in undump broken |
e.g. on line 596 of XML-Dumper-0.74 Dumper.pm
$class =~ m/^[\w-]+(?=::[\w-]+)*$/
The - at the end of the character class is interpreted as an ordinary character. From perldoc perlretut
"If '-' is the first or last character in a character
class, it is treated as an ordinary character; "[-ab]",
"[ab-]" and "[a\-b]" are all equivalent."
So it wouldn't match classes like
'Blah::Foo::MyClass'
Not sure if this is what you're trying to do but this works for me.
$class =~ m/^\w+(::\w+)*$/