in reply to How to redefine subroutines with Attribute::Handlers that run at BEGIN time?

I would suggest reporting your difficulty to p5p and hope that your feedback will help improve the implementation of attributes to make your problem go away.

In the meantime my preferred solution would be to refactor your code so that the code which needs to be wrapped is not called from do. If that won't work, then the best that I can think of is to provide a function which does the wraps, and make sure that the scripts which need it call that at the top of the script, at runtime.

  • Comment on Re: How to redefine subroutines with Attribute::Handlers that run at BEGIN time?