develooper Front page | perl.perl5.porters | Postings from August 2010

Re: Any opposition still to the idea of syntax indicating defaultregex modifiers?

Thread Previous | Thread Next
From:
Ben Morrow
Date:
August 12, 2010 21:27
Subject:
Re: Any opposition still to the idea of syntax indicating defaultregex modifiers?
Message ID:
20100813042656.GA32764@osiris.mauzo.dyndns.org
Quoth public@khwilliamson.com (karl williamson):
> Ben Morrow wrote:
> > At 11AM -0600 on 11/08/10 you (karl williamson) wrote:
> >> Ben Morrow wrote:
> >>> Quoth public@khwilliamson.com (karl williamson):
> >>>> +Starting in Perl 5.14, a C<.> (dot) immediately after the C<?> is a
> >>>> +shorthand equivalent to C<-imsx>.  Any positive or negative flags may
> >>>> +follow the dot, so
> >>>> +
> >>>> +    (?.x-i:foo)
> >>>> +
> >>>> +is equivalent to
> >>>> +
> >>>> +    (?x-ims:foo)
> >>>> +
> >>>> +(The C<-i> wasn't necessary, but did no harm.)
> >>> FWIW I'm not convinced allowing (?.-i:
> >> Please explain your concerns.
> > 
> > It's always redundant, so any situation where it appears is
> > unnecessarily confusing. (You do realise I'm not talking about -i
> > specifically, but about *any* negated flags?)
> > 
> > To go back to my chmod analogy, we have a+x and a-x and a=x, but not
> > a=-x, because that would be silly.
>
> Do you want a warning or an error?

I want it to not be valid syntax, just as though I'd written

    /(?.x!i:foo)/

or anything else invalid. I suppose that means 'error', but just an
ordinary 'Sequence not recognized in regex' error, not a special case.

Ben


Thread Previous | 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