Trapping (or "transparent wrapping") of function/method calls can be used, among others, to add a layer of authentication or for logging/debugging or even perhaps some interesting programming techniques. Ruby has
which can be used for this purpose. Does Perl have something equivalent or to the same effect? The AUTOLOAD mechanism works only for calling non-existing subs (equivalent to Ruby's