in reply to Testing for readdir failure
use warnings; no warnings 'uninitialized';
into my code. (I included the no warnings because setting a variable to undef and then referring to that variable produces an uninitialized error, though what it clearly means is undefined, not uninitialized.)
This week's run failed in the old way, and there were no warnings issued.
I did NOT test the value of $! after the readdir because readdir does not set its value, as shown by this small piece of code executed under the debugger:
DB<9> p opendir(D,'.') 1 DB<10> p $!+0 2 DB<11> $! = 147 DB<12> p $!+0 147 DB<13> @d = readdir(D) DB<14> p $!+0 147 DB<15>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Testing for readdir failure
by Anonymous Monk on May 25, 2013 at 00:42 UTC | |
|
Re^2: Testing for readdir failure (debugger)
by LanX (Saint) on May 25, 2013 at 01:25 UTC |