in reply to How come I cannot delete file with unlink

You are making several serious mistakes here.

First mistake is that you are not checking the return value of unlink. I'm a bit surprised you made it to the front page with such a mistake. There's no need to go asking around why your program "doesn't work" if you refuse to let Perl help you. Always, ALWAYS, ALWAYS check the return value of system calls. Just do it. $! would have told you what was wrong. You say it outcome no error. Well, duh. You're ignoring the error, silencing Perl.

Your second mistake is the use of single quotes, as was pointed out in another post. You need double quotes there, or the concatenation operator.

Third mistake is assuming that unlinking a file actually deletes it. It doesn't have to. A file could still have other names (hard links), or open file handles. While the name might be gone from the filesystem, the file itself only disappears if all its names are gone, and all the open handles are closed.

-- Abigail