Skip Menu |

This queue is for tickets about the Data-Dump CPAN distribution.

Report information
The Basics
Id: 112441
Status: new
Priority: 0/
Queue: Data-Dump

People
Owner: Nobody in particular
Requestors: ferreira [...] cpan.org
Cc:
AdminCc:

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



Subject: Deal with blessed regexes
Regex objects (like qr/Foo/) are kind of special in Perl because they have a REGEXP reftype but are blessed into "Regexp" package. That means it is not desirable to dump qr/Foo/ into bless(qr/Foo/, "Regexp") which is redudant, but if the blessed package is other than "Regexp" it is necessary to resort to the "bless" expression, as in bless(qr/Foo/, "Regexp::Alt") Currently, this is the output by Data::Dump for such cases: perl -MData::Dump=pp -e 'pp(bless qr/Foo/, "Regexp::Alt")' do { my $a = bless(do{\(my $o = do{my $fix})}, "Regexp::Alt"); $$a = $a; $a; } With the changes in this pull request https://github.com/gisle/data-dump/pull/15, the output becomes perl -MData::Dump=pp -e 'pp(bless qr/Foo/, "Regexp::Alt")' bless(qr/Foo/, "Regexp::Alt") which evaluates correctly and follows what Data::Dumper and Data::Dump::Streamer do.