in reply to Re^2: Perl file handles
in thread Perl file handles

Wrong order. Closing DATA after the child has finished running will have little effect on the child.

Replies are listed 'Best First'.
Re^4: Perl file handles
by CleverHanz (Novice) on Mar 06, 2009 at 20:29 UTC
    Ah! that did work.

    So, the idea is to close the DATA handle BEFORE you spawn the child, so the handle is not passed to it in the first place?

    I was thinking you closed the handle between the child being spawned and the parent process closing. But then I assume the child would still have a pointer back to the originating file?

    I am still unclear about how threading in perl works.

      No, the idea is to close the DATA handle BEFORE you spawn the child in order to release the lock BEFORE the child tries to delete the file.

      I am still unclear about how threading in perl works.

      I don't see how this is relevant to this conversation.