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:
Tom Molesworth via perl5-porters
Date:
January 1, 2018 10:27
Subject:
Re: RFC: deprecate literal \v in patterns except under /x; /[#]/xx
Message ID:
CAGXhHdnC6AVYBD2oDfN+YK8CDfVh5m9yEP4-F=cg-nh9ztsEMQ@mail.gmail.com
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.

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

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