develooper Front page | perl.perl5.porters | Postings from June 2016

Re: RFC: deprecate quantifying zero-length constructs in regexpatterns

Thread Previous | Thread Next
June 3, 2016 10:16
Re: RFC: deprecate quantifying zero-length constructs in regexpatterns
Message ID:
Abigail writes:

> On Thu, Jun 02, 2016 at 11:05:56AM +0100, Smylers wrote:
> > How about consistently warning on all the examples Karl gave above?
> > 
> > Anybody generating patterns from fragments who is effectively saying
> > ‘this may be nonsensical but I don't care’ could disable the
> > warning. Intentionally doing something potentially nonsensical is
> > the paradigm of when it makes sense to disable a warning.
> > 
> > And given that some of the above situations already do warn, anybody
> > generating patterns like this probably should already be disabling
> > relevant warnings anyway, in which case making more situations issue
> > warnings in the same category won't affect them.
> While you can disable warnings when you are generating the patterns,
> you don't always have control over the point it's being used.
> Specially not if your pattern generating stuff is in separate module.
> And not all generated patterns will be generated as qr // constructs.
> I very often generate them as strings.
> (Ergo, I'm not too much of a fan of these warnings).

Removing all of the existing warnings would also be consistent, and
arguably an improvement on the current situation.

Having warnings in some of these situations but not others doesn't seem
to be useful for anybody.


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