New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readline: sets $! even if no error occured #8289
Comments
From Nikolaus@rath.orgCreated by Nikolaus@rath.orgThis is a bug report for perl from Nikolaus@rath.org, ----------------------------------------------------------------- Apparently, readline sets $! to "invalid filedescriptor" even if no [0] nokile:~/Work$ cat perlbug2.pl # Overload IO::File to die on errors sub getline { ######## MAIN PROGRAM ########## my $fh = new IO::File::Fatal(shift(), "<"); [0] nokile:~/Work$ echo "Just one line" > data [0] nokile:~/Work$ ./perlbug2.pl data [9] nokile:~/Work$ Perl Info
|
From eric-amick@comcast.net
From the entry for $! in perlvar: This means that the value of $! is meaningful only *immediately* after a The readline was successful, so you shouldn't be checking $!. Not a bug. |
From @tamiasOn Fri, Jan 20, 2006 at 12:46:34PM -0800, Eric Amick via RT wrote:
However, from the entry for readline: If readline encounters an operating system error, $! will be for (;;) { I think this example is in error. Ronald |
The RT System itself - Status changed from 'new' to 'open' |
From @demerphqOn 1/21/06, Ronald J Kimball <rjk-perl-p5p@tamias.net> wrote:
Why? Note the difference between the example and the op. One undef's $! IMO the op should have said: sub getline { Cheers, -- |
From Nikolaus@rath.org
So how do I know whether readline was successful if I can't check $!? An Apart from that, perldoc -f readline recommends checking $!. |
From Nikolaus@rath.org
Well, I inserted warn() only after discovering the problem. Checking $! However, I still consider the current behaviour a bug. Is there any |
From Mark.Martinec@ijs.si
It is not a bug, this follows the same principle as all system IMO, this ticket should be closed as 'not a bug'. Btw, there is a similar bug report #39060, but that one Mark |
From skasal@redhat.comOn Wed May 03 08:15:10 2006, mmartinec wrote:
I reviewed this and I agree with the reasoning. So I'm trying to close |
@nwc10 - Status changed from 'open' to 'resolved' |
skasal@redhat.com - Status changed from 'resolved' to 'rejected' |
Migrated from rt.perl.org#38285 (status was 'rejected')
Searchable as RT38285$
The text was updated successfully, but these errors were encountered: