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

Re: RFC: New regex modifier flags

Thread Previous | Thread Next
David Golden
August 6, 2010 05:14
Re: RFC: New regex modifier flags
Message ID:
On Fri, Aug 6, 2010 at 7:36 AM, karl williamson <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About