develooper Front page | perl.perl5.porters | Postings from March 2014

Re: deprecate /\C/ ?

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
March 26, 2014 12:16
Subject:
Re: deprecate /\C/ ?
Message ID:
20140326121558.GV1615@iabyn.com
On Thu, Dec 12, 2013 at 09:48:40PM -0500, Ricardo Signes wrote:
> * Father Chrysostomos <sprout@cpan.org> [2013-12-12T17:28:27]
> > Dave Mitchell asked:
> > > Can we deprecate the \C regex ecscape?
> > 
> > Yes, please!
> 
> What he said!

It's a bit late to be adding a deprecation warning for 5.20, so I've just
documented it for now:

    commit 37ea023e4dd4082193ed4d0b88f61693ce4eb5b1
    Author:     David Mitchell <davem@iabyn.com>
    AuthorDate: Wed Mar 26 12:07:39 2014 +0000
    Commit:     David Mitchell <davem@iabyn.com>
    CommitDate: Wed Mar 26 12:07:39 2014 +0000

    Deprecate /\C/
    
    For 5.20, just say its deprecated. We'll add a warning in 5.22
    and change its behaviour in 5.24.

In particular, here's the bit I added to Porting/perl5200delta.pod

    +The C</\C/> regular expression character class is deprecated. From perl
    +5.22 onwards it will generate a warning, and from perl 5.24 onwards it
    +will in addition behave identically to C</./>. If you need to examine the
    +individual bytes that make up a UTF8-encode character, then use
    +C<utf8::encode()> on the string (or a copy) first.


I'm open to the suggestion that /\C/ should become a regex-compile-time
error rather than becoming equal to /./


-- 
Modern art:
    "That's easy, I could have done that!"
    "Ah, but you didn't!"

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