Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How to wrap a subroutine

by eyepopslikeamosquito (Archbishop)
on Feb 06, 2015 at 07:00 UTC ( [id://1115738]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1115738]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found