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

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

Thread Next
Karl Williamson via RT
November 12, 2012 19:59
[perl #115430] Data::Dumper of regexps not idempotent
Message ID:
On Wed Oct 24 12:37:42 2012, wrote:
> On 10/24/2012 09:33 AM, demerphq wrote:
> > On 23 October 2012 15:45, Brad Gilbert <> 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 is still the 
> appropriate place to file bugs. Data::Dumper is maintained as part of 
> the core.
> --Steffen

I looked at 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
        # 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

Karl Williamson

via perlbug:  queue: perl5 status: open

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About