develooper Front page | perl.perl5.porters | Postings from November 2012

[perl #115430] Data::Dumper of regexps not idempotent

Thread Next
From:
Karl Williamson via RT
Date:
November 12, 2012 19:59
Subject:
[perl #115430] Data::Dumper of regexps not idempotent
Message ID:
rt-3.6.HEAD-17500-1352779179-714.115430-15-0@perl.org
On Wed Oct 24 12:37:42 2012, smueller@cpan.org wrote:
> On 10/24/2012 09:33 AM, demerphq wrote:
> > On 23 October 2012 15:45, Brad Gilbert <b2gills@gmail.com> wrote:
> >> The problem is internal to perl, so any module that prints it out will
> >> exhibit the same behaviour.
> >
> > Actually no it is not a core bug, it is a deficiency in the logic used
> > by DD and other modules.  Data::Dump::Streamer has been doing this
> > right for years, and the code to support doing it right was migrated
> > from DDS to core long ago. See re::regexp_pattern() in list context.
> 
> It is a bug in DD, not the core. But rt.perl.org is still the 
> appropriate place to file bugs. Data::Dumper is maintained as part of 
> the core.
> 
> --Steffen
> 

I looked at Data::Dumper.pm source, and see this outdated comment:
        # This really sucks, re:regexp_pattern is in ext/re/re.xs and
not in 
        # universal.c, and even worse we cant just require that re to be
loaded
        # we *have* to use() it. 
        # We should probably move it to universal.c for 5.10.1 and fix this.
        # Currently we only use re::regexp_pattern when the re is
blessed into another
        # package. This has the disadvantage of meaning that a DD dump
won't round trip
        # as the pattern will be repeatedly wrapped with the same modifiers.
        # This is an aesthetic issue so we will leave it for now, but we
could use
        # regexp_pattern() in list context to get the modifiers separately.
        # But since this means loading the full debugging engine in
process we wont
        # bother unless its necessary for accuracy.

The reason it is outdated is that re::regexp_pattern has been put in
universal.c


-- 
Karl Williamson

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=115430

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About