in reply to Deleting or unlinking a file

In addition to the comments above, when a function does not appear to work then maybe you should consider checking the result to see why? Maybe you should always check?
unlink $filename or die "Unable to unlink $filename: $!";
By the way, it is called unlink because that is the C API name to delete a file on UNIX, and it is rather descriptive.