Correct me if I'm wrong here, but doesn't -w myfilehandle
tell you whether the file that myfilehandle
is pointing to has its writable bits set? That's not what I want to know. I want to know if the filehandle is open for writing. You could open a writable file for reading. Then you couldn't write to it with that handle even though passing that handle to -w
would still return true. Or have I been smoking the curtains again?
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."