Suppose I have some methods do_something(), do_nothing(), do_less(), do_more(),etc in a module.
The around method modifier receives a code ref to the original method as given in Moose Documentation. The same around method is for all the methods in my module. do_something() is called from my script, $orig prints a code ref address which is different from the the address I get when I directly print \&do_something inside the around method or the module or the script (uses the module).
Could someone explain me why this happens? I want to perform an additional check when $orig equals do_something() inside the around method, any suggestions on how to since $orig and \&do_something are giving different code refs.
In reply to Code ref inside around modifier by #perl_noob
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |