develooper Front page | perl.perl5.porters | Postings from October 2007

Re: [PATCH] New failing test for RT#45667 (m/[#]/x treated inconsistently)

Thread Previous | Thread Next
October 30, 2007 07:04
Re: [PATCH] New failing test for RT#45667 (m/[#]/x treated inconsistently)
Message ID:
On 10/30/07, Rafael Garcia-Suarez <> wrote:
> On 28/10/2007, Chris Dolan <> wrote:
> > Hello,
> >
> > RT#45667 points out that the Perl parser and the Regexp parser treat
> > m/[#]/x differently.  The former treats the # as a comment character
> > and the latter treats it as a literal.  I propose that we adopt the
> > Perl parser's behavior because 1) doing otherwise would require us to
> > add more regexp-specific knowledge to the Perl parser and 2) other
> > Regexp engines may not want to treat [#] the same as the current
> > default engine.
> >
> > The patch below adds a (currently failing) test to the regexp parser
> > to enforce this decision.  The patch is against rsync
> it doesn't seem that op/regexp.t supports TODO tests. That would
> probably be a worthwhile addition...

Probably is. But im not entirely comfortable with the original patch.
Its not clear to me that we can change this behaviour anymore. At
least not in the regex engine. Its actually probably easier to change
this in the perl parser, which we long term intend to change anyway in
order to resolve the whole qr// as closure stuff as well as variable
bindings amongst other issues.

Probably a good idea if Dave Mitchell speaks up on this one as to my
knowledge he has the most developed idea of the future of this.


perl -Mre=debug -e "/just|another|perl|hacker/"

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