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

Re: RFC: New regex modifier flags

Thread Previous | Thread Next
From:
David Golden
Date:
August 6, 2010 05:14
Subject:
Re: RFC: New regex modifier flags
Message ID:
AANLkTimYakcbMZ-v=KHAxtRSjkKw7JXwFJo2UoRQMwoe@mail.gmail.com
On Fri, Aug 6, 2010 at 7:36 AM, karl williamson <public@khwilliamson.com> wrote:
> I did an analysis of this, and it turns out that the only ambiguous case is
> 's/foo/bar/le'.  It seems like overkill for this to invent a new temporary
> pragma, and forbid all the new modifiers as suffixes, when there is no
> ambiguity at all outside of substitutions, and no ambiguity  using
> substitutions except for one  combination out of all those possible.  Why
> can't we just say in the pods and warning message that '/le'  must be
> written as '/el' in 5.14?

Help me understand what you mean by ambiguous. If there is really only
one case, then great!

But hypothetically, what would s/foo/bar/elt1 do?  Would the "l" parse
as a modifier or would it parse as bar of "lt"?

Here's a stupid, but legal example:

  $ perl -wE '$_=<>; sub bar { "bar" }; if ( s/foo/bar/elt 1 ) { say
"not done" }'

-- David

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