On Mon Jan 31 03:33:15 2011, demerphq wrote: > Data::Dump::Streamer does this properly, and there is no longer any > reason that DD does not. The routine that DDS uses for this has been > in core in the re namespace for some time: > > my ($pat,$mods)=regexp_pattern(qr/foo/i); > > So DD could use it to extract the flags and pattern without them being > wrapped in (?...) brackets, and thus round trip regexen properly. Data::Dumper has code to do this, but it's only used when the regexp is blessed into another package. And the XS Dumper doesn't do it at all. I've attached a patch that modifies Data::Dumper to dump regexp objects using the list form of regexp_pattern(), both in the perl and XS code paths. Is this the desired behaviour? One thing neither the old nor the new code handles specially is regexps containing control characters or unicode - they're simply included as is in the dumped string, I bring this up since the discussion in 113088 implied that it was useful for Data::Dumper to produce pure ASCII. Tony --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=82948