in reply to Core module: Attribute::Handlers behaviour
use Attribute::Handlers; sub TRACE :ATTR(CODE) { ... }
Then your sub TRACE will be called once if you write
sub mysub :TRACE { }
but it will not be called for each call of mysub.
So to achieve what you want, you have to write your TRACE function in a way that, if the appropriate configuration option is set, it wraps the function in a way that makes the tracing happen. Maybe Hook::LexWrap can be helpful for that purpose.
|
|---|