For the heck of it, I'll suggest the low-tech approach of building a list of routines at BEGIN time and excluding these from the list of traits built at run time.
It isn't obvious from a quick glance when / how the post-compilation moving of all subroutines happens (I guess when the trait-implementing package gets imported), but that must already be happening. So all you need to add is code to cache the list of to-exclude subroutines when Class::Trait::import is called (and then exclude them, of course).
Of course, this means that the user needs to 'use' modules that import non-traits before 'use'ing Class::Trait. But it also means that the user can do creative things that 'import' subroutines that are meant to be traits... Which I find rather appealing.
- tye
In reply to Re: Detecting an imported function (exclude time)
by tye
in thread Detecting an imported function
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |