When you talk about package scope, do you mean you want to listen to specific call flows?
If so, then Joost is right, and this is a job for Aspect . Version 0.10 will be out today.
Here is how to print foo each time Employee::calc_* is called, but only if Company::calc_salaries exists in the call flow. So if the call flow is Test::test_employee ... Employee::calc_salary, then it will not be printed:
use Aspect; before { print 'foo' } call qr/^Employee::calc_/ & cflow company => 'Company::calc_salaries';
There is also the Listenable aspect (Aspect-0.10), for a full implementation of Observer. But because you have pointcuts, you can fire events only in some call flow. Which you cannot do with normal Observer.
In reply to Re: Package level scope callbacks.
by mvc
in thread Package level scope callbacks.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |