Skip Menu |

This queue is for tickets about the XML-Dumper CPAN distribution.

Report information
The Basics
Id: 13453
Status: resolved
Priority: 0/
Queue: XML-Dumper

People
Owner: Nobody in particular
Requestors: kerry.jones [...] bbc.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.74
Fixed in: (no value)



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+)*$/
Fixed this the day that I got the request. Now I can attribute the patch! - m. [guest - Tue Jun 28 13:00:21 2005]: Show quoted text
> 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+)*$/