develooper Front page | perl.perl5.porters | Postings from February 2015

[perl #123739] Bleadperl v5.21.8-197-g5fe499a breaks 5 x CPAN

From:
Tony Cook via RT
Date:
February 17, 2015 04:42
Subject:
[perl #123739] Bleadperl v5.21.8-197-g5fe499a breaks 5 x CPAN
Message ID:
rt-4.0.18-19852-1424148172-1656.123739-15-0@perl.org
On Mon Feb 09 05:20:09 2015, hmbrand wrote:
> On Sun, 8 Feb 2015 12:39:30 -0800, "Father Chrysostomos via RT"
> <perlbug-followup@perl.org> wrote:
> 
> > OK, the weird thing going on here is that $/ and PL_rs are separate
> > SVs.  According to perl’s previous behaviour, reading $/ would *not*
> > read PL_rs, but setting $/ *would* set PL_rs.
> >
> > If you are localising just PL_rs, then you will change the behaviour
> > of <>, but anyone reading $/ will see the old value.
> >
> > In any case, this change happened too late in the developement
> > series, so I am going to change it back (and fix the bug another
> > way).  So you don’t need to fix any of the modules.
> >
> > But you may want to consider whether the localised PL_rs is giving
> > you the behaviour you want.  In particular, I would appreciate
> > feedback *from you* regarding what perl should be doing.
> 
> Here is an example of a test file that IMHO should PASS:

There's a bug in your test code.

The inner part of the string created has *four* lines ending with $deol - the three created by the initial loop, and the fourth by the iteration over the end-of-lines in reverse, but your test code only consumes 3 of them.

If you change:

     is (scalar <$fh>, "line ".$line++.$eol, DDisplay ($eol)."\t<> after local \$/ = \$/");
 {   my $eol = shift @eol or last EOL;
     local $/ = $eol;
     is (scalar <$fh>, "line ".$line++.$eol, DDisplay ($eol)."\t<> after local \$/");
     is ($/, $eol,                           DDisplay ($eol)."\tread \$/");
     is (scalar <$fh>, "line ".$line++.$eol, DDisplay ($eol)."\t<> after read");
     local $/ = $/;      # copy with self
     is (scalar <$fh>, "line ".$line++.$eol, DDisplay ($eol)."\t<> after local \$/ = \$/");
+     is (scalar <$fh>, "line ".$line++.$eol, DDisplay ($eol)."\t<> after local \$/ = \$/");
 }   is (scalar <$fh>, "line ".$line++.$eol, DDisplay ($eol)."\t<> after scope end");
     is ($/, $eol,                           DDisplay ($eol)."\t\$/ after scope end");

The test passes.

Closing this ticket.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=123739



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About