This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deparse: don't remove escapes for tabs in patterns
authorDavid Mitchell <davem@iabyn.com>
Thu, 23 Feb 2017 10:53:10 +0000 (10:53 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 5 Jun 2017 11:52:17 +0000 (12:52 +0100)
commit4d7ac81a3c0ccb379bb5cb05d2c845b706f7289b
treeb4b15b04711ee8c231efeb70c09e96118bb68106
parent27daf5669559d9755c5886825536aefd01d540ca
Deparse: don't remove escapes for tabs in patterns

In the following, the T represents a literal tab character.

/\T/ and /\T/x were being deparsed as /T/ and /T/x.
In the particular case of /\T/x that actually changed the pattern's
meaning.

So don't do that: leave the backslashes alone.

This makes
    ./TEST -deparse t/re/keep_tabs.t
pass.
lib/B/Deparse.pm
lib/B/Deparse.t