in reply to Re: Help Explain Behavior
in thread Help Explain Behavior

Now that seems really strange to me. I understand that the whole script was already loaded into memory by the time the unlink happens; but shouldn't the file vanish after the unlink?

Replies are listed 'Best First'.
Re^3: Help Explain Behavior
by BrowserUk (Patriarch) on Aug 19, 2012 at 18:00 UTC

    When Perl loads the script, it retains an open filehandle to the source. The filesystem won't allow the file to be deleted until all open filehandles are closed.

    So until the script ends, the source file is in a "marked for deletion" state.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      Thanks, I get it now.