in reply to Re^3: Testing for readdir failure (Perl-bug)
in thread Testing for readdir failure

@a = readdir(D) or process_errno();

So you are assuming, if for example an I/O error occurs while the directory is being read, that the result of readdir will be an empty (or undefined) directory. Is that guaranteed to be true? It seemed to me that it might instead provide as much of the directory as it successfully read.

  • Comment on Re^4: Testing for readdir failure (Perl-bug)

Replies are listed 'Best First'.
Re^5: Testing for readdir failure (Perl-bug)
by LanX (Saint) on May 27, 2013 at 23:58 UTC
    Ups sorry I was in a hurry!

    Of course you're right this is nonsense!

    I just copied the open() || die pattern, even with the wrong or operator.

    Forget what I said, your version of testing '$!' in the next line should be fine!

    Cheers Rolf

    ( addicted to the Perl Programming Language)