in reply to How to wrap a subroutine

Your question is unclear. If you're asking how to override the built-in unlink, see perlsub and CORE. But maybe try to explain instead what you actually want your program to achieve and what difficulties you're having with it.