Fellow monks:
I come before you to request the help of your collective wisdom for this problem...
For a module I am writing, I want to create a kind of filter that removes extraneous data from the calls to methods that are defined by third party modules. In this particular example, I am failing miserably to do so with warnings::warn
*clone_warn = *warnings::warn; *warnings::warn = sub { print "Look ma!\n"; clone_warn(some_filter_function_i_provide @_); };
The problem is that as soon as I change warnings::warn, the alias I keep in clone_warn also changes, as would be expected. I've also tried any number of combinations of code references, closures, GLOBs to no avail.
What I want to achieve is the redefinition of the original function (warnings::warn) while keeping a reference to the original implementation, so that I can call it from my version. This is similar in concept to a proxy method or a call to ->SUPER::foo() in OO terms.
How can I achieve this? There has to be a way to do it...
Best regards
-lem, but some call me fokat
In reply to How to stack a call to a class method by fokat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |