#perl_noob has asked for the wisdom of the Perl Monks concerning the following question:
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Code ref inside around modifier (updated)
by haukex (Archbishop) on Apr 11, 2017 at 09:26 UTC | |
by #perl_noob (Acolyte) on Apr 11, 2017 at 09:58 UTC | |
|
Re: Code ref inside around modifier
by shmem (Chancellor) on Apr 11, 2017 at 09:32 UTC |