|There's more than one way to do things|
Re^2: Core module: Attribute::Handlers behaviourby BrowserUk (Pope)
|on Oct 20, 2012 at 16:20 UTC||Need Help??|
Perl attributes are typically handled at CHECK time - between compile time (BEGIN) and INIT time, and way before run time. Your eval happens at run time, so too late to effect attribute processing.
Hm. That doesn't ring true.
This script that eval's it into being:
So, if the attribute handling can be done at BEGIN time, then it is quite simple to wrap the attributed function over in a wrapper that did the tracing,
Tweak junk.pm above to be::
And main to be:
And you get:
which is kind of cool. (Shame the function name isn't provided to the attribute handler.)
It'd be better if installing the TRACE attr into UNIVERSAL would then apply the wrappers to runtime loaded modules; and better yet if you you could use a "trace handler" package once in main and have it apply itself everywhere.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.