develooper Front page | perl.perl5.porters | Postings from January 2018

Re: RFC: deprecate literal \v in patterns except under /x; /[#]/xx

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
January 1, 2018 01:18
Subject:
Re: RFC: deprecate literal \v in patterns except under /x; /[#]/xx
Message ID:
20180101011754.30136.qmail@lists-nntp.develooper.com
Karl Williamson wrote:
> I am proposing two deprecations
> 
> First, using literal vertical space, such as a form feed or new line, in
> a regular expression pattern unless that pattern is /x.  My guess is
> that this is extremely uncommon, and that just about all such
> occurrences would be from forgetting the /x.  So deprecating this should
> affect hardly anyone.

What about generated code?  Why introduce a discrepancy between dif-
ferent quote-like operators with regard to vertical whitespace?  Will
quotemeta start quoting these characters so that we can do
eval "/\Q$string\E/"?

>   The reason I believe it is uncommon is that when
> displayed the pattern would look something like this:
> 
>         abc
>             def
> or the def would overwrite the abc if the vertical space is a carriage
> return.

It depends on your editor and OS.  On a Mac, a carriage return is just
a new line.

> Second, in order to make the new /xx modifier more useful (and yes, this
> should have been made experimental) I want to deprecate '#' occurring in
> a bracketed character class.

*Only* under /xx.  Do not forget that [x] is a common way of
escaping x.

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