develooper Front page | perl.perl5.porters | Postings from September 2017

Re: [perl #131930] s [foo] \n [bar] confuses line numbers

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
September 11, 2017 07:06
Subject:
Re: [perl #131930] s [foo] \n [bar] confuses line numbers
Message ID:
20170911070559.GE3083@iabyn.com
On Sat, Aug 19, 2017 at 06:40:24PM -0700, Father Chrysostomos via RT wrote:
> > #!/opt/perl/bin/perl
> > 
> > use 5.010;
> > 
> > say "This is line " . __LINE__;
> > s [foo]
> >   [bar];
> > say "This is line " . __LINE__;
> > 
> > __END__
> > 
> > Now it gets the second line number wrong:
> > 
> > This is line 5
> > This is line 7
> 
> perl5.24.2 is fine, so it was introduced some time between 5.24.0 and 5.26.0.

It bisects to this. I'll have a further look sometime.

6432a58ad9a504c2dc834eb0d131a10b4b6c886b is the first bad commit
commit 6432a58ad9a504c2dc834eb0d131a10b4b6c886b
Author: David Mitchell <davem@iabyn.com>
Date:   Thu Nov 10 21:38:30 2016 +0000

    Eliminate SVrepl_EVAL and SvEVALED()
    
    This flag is only used to indicate that the SV holding the text of the
    replacement part of a s/// has seen at least one /e.
    
    Instead, set the IVX field in the SV to a true value.
    (We already set the NVX field on that SV to indicate a multi-src-line
    substitution).
    
    This is to reduce the number of odd special cases for the SVpbm_VALID flag.


-- 
Justice is when you get what you deserve.
Law is when you get what you pay for.

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