Heads up: perl readline $! no longer broken

Stepan Kasal skasal at redhat.com
Fri Jun 12 15:16:44 UTC 2009


Hello,
  a long standing perl bug was recently fixed in Fedora.

Namely, perl-5.10.0-69 from Jun 3 fixes bug #221113, a.k.a.
http://rt.perl.org/rt3/Ticket/Display.html?id=39060

The problem was that $! was incorrectly set to "Bad file descriptor",
even though EOF was reached without any error.

The bug lived several years and tought people not to check $!.
Really nasty.
People should check always errno.  It is now possible!
Please help spread the word.

Alternatively, people might have written a code that _expects_ the
incorrect errno.  That code needs to be fixed.  For example:

> --- Data-Dump-Streamer-2.09/t/madness.t.orig	2009-06-12 16:50:09.343385762 +0200
> +++ Data-Dump-Streamer-2.09/t/madness.t	2009-06-12 16:50:19.376389596 +0200
> @@ -260,3 +260,3 @@ _EOF_FORMAT_
>             PV8 => "ab\ncd\x{20ac}\t",
> -           PVM => 'Bad file descriptor',
> +           PVM => '',
>             RV  => \do { my $v = undef },

This is whet Iain Arnell had to do a few moments ago.
This commit made it clear to me that I have to write this
announcement.  Sorry, Iain and sorry to all others, that this has not
came to my mind earlier.

Have a nice day,
	Stepan




More information about the Fedora-perl-devel-list mailing list