in reply to Dup & redirecting filehandles

Could I possibly get any sample code out of you? I've spent literally hours trying things myself (and ran across many of the same pages on google over and over trying to get it to work)...i've also tried throwing in an open(RESULT); before reading from it, but it still doesn't work. -w tells me its trying to read from a closed filehandle (even with the open there)...i'm basically clueless at this point.

Replies are listed 'Best First'.
RE: Re: Dup & redirecting filehandles
by Fastolfe (Vicar) on Oct 24, 2000 at 18:47 UTC
    Are you checking the return values of things like open? Just because you have an open statement in your code does not necessarily mean you will have an opened file handle right after it. Be sure open succeeded.