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

Re: PATCH: [perl #58182] partial, "The Unicode Bug". Add unicode semantics for \s, \w

Thread Previous | Thread Next
From:
Eric Brine
Date:
May 19, 2010 11:49
Subject:
Re: PATCH: [perl #58182] partial, "The Unicode Bug". Add unicode semantics for \s, \w
Message ID:
AANLkTikqEkT3_j3V0BPh9kaWTnYgUMTrDN0XkWnhdErO@mail.gmail.com
On Wed, May 19, 2010 at 2:20 PM, karl williamson <public@khwilliamson.com>wrote:

> I don't understand these preclusions.  Why, for example, does the existence
> of 'and' preclude /a, but the existence of 'unless' not preclude /u ?


When used as a statement modifier.

$ perl -le'$x+=/foo/unless$c; print "ok"'
ok

If we add /u, the above would die as follows:

Bareword found where operator expected at -e line 1, near "/foo/unless"
        (Missing operator before nless?)
syntax error at -e line 1, near "/foo/unless"
Execution of -e aborted due to compilation errors.

"Preclude" is not quite the right word, at least not on its own. They
preclude the addition of the modifier without some form of conflict
resolution. Most of the conflicts can even be resolved cleanly by lookahead.
(/l isn't resolved cleanly by lookahead.)


> Instead of creating a syntax error, we deprecate in 5.14 not inserting a
> space between a pattern terminator and the following word.
>

That still breaks backwards compatibility, and we'd have to wait for 5.016
to get /u and /l in.

"use 5.014;" avoids both the break and the wait. It could either add /u and
/l, or it could add the space requirement.

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