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:
Karl Williamson
Date:
January 1, 2018 18:31
Subject:
Re: RFC: deprecate literal \v in patterns except under /x; /[#]/xx
Message ID:
24111257-cf1d-21a9-049e-0cff250adea0@khwilliamson.com
On 01/01/2018 03:26 AM, Tom Molesworth wrote:
> On 1 January 2018 at 04:31, Karl Williamson <public@khwilliamson.com> 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.  The reason I believe it is uncommon is that when displayed the pattern would look something like this:
> 
> 
> Just to be clear, this would affect cases like this?
> 
> my ($name, $description) = m{
> =head1 NAME
> 
> (\S+) - (.*)
> 
> =};
> 
> If so, that seems very inconvenient. I've seen (and used) literal \n
> in non-/x regex quite often.

The above sinks the proposal.  Thank you for responding.

> 
> Are there benefits aside from the "maybe you wanted /x" warning?
> 

It's a prerequisite for the /xx work.

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