in reply to Re: Testing for readdir failure
in thread Testing for readdir failure
DB<137> $!=undef; readdir $x or print 0+$!," ",$! 9 Bad file descriptor
a) Each line is evaled in a different context!
b) The debugger saves and restores special variables between evals, cause otherwise evaled code would change the error-state of the debugged program.
Thanks BTW for discovering this!
It shows fundamental differences between debugger and REPL functionality!
seems that I was wrong, the debugger can handle ERRNO in different lines, it's '$!=undef' which does the difference!
DB<100> opendir $x,'.';closedir $x; DB<101> readdir $x DB<102> print 0+$!," ",$! 29 Illegal seek DB<103> $!=undef DB<104> readdir $x DB<105> print 0+$!," ",$! 9 Bad file descriptor
For more details see Re: Testing for readdir failure (Perl-bug)
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|