in reply to How to wrap a subroutine

Minor nit:

unlink "$file_name"; # you don't need the quotes here unlink $file_name; # ... so suggest you write it like this

More importantly, you are currently ignoring all unlink failures. Are you happy to ignore them? What are your error handling requirements?

If you simply want to write a new function, please don't call it unlink.

OTOH, if you really, truly want to override the built-in unlink function, that is an XY Problem and you need to tell us the real underlying problem you are trying to solve, why you think overriding unlink is a good way to solve it, and what alternatives you have considered.