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

Re: Pre-RFC: s/.../.../gg Really globally substitute

Thread Previous
From:
Dan Book
Date:
June 29, 2022 17:04
Subject:
Re: Pre-RFC: s/.../.../gg Really globally substitute
Message ID:
CABMkAVXyEbeQTDv7JvN_ic+rCJ6MsQXf6DuV4L=iNNg5NmjMmA@mail.gmail.com
On Wed, Jun 29, 2022 at 9:50 AM G.W. Haywood via perl5-porters <
perl5-porters@perl.org> wrote:

> Hi there,
>
> On Wed, 29 Jun 2022, James Raspass wrote:
>
> > ...
> > I feel like we could replace this pattern with a dedicated flag that
> > is clearer and potentially faster, /gg, e.g.
> >
> > s/(\d)(\d\d\d)(?!\d)/$1,$2/gg;
> > ...
> > Thoughts?
>
> I don't see any pressing need.
>
> It would just be asking for problems.
>
> I prefer it the way it is.
>
> There are more important things to be getting on with.
>

I have had a couple instances where this would be useful. But I have to
agree, it is not worth a feature for when the use case is rare and one can
simply loop. Additionally I would have a concern that such a feature would
commonly lead to infinite looping.

-Dan

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About