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

So I have no where I can assign the newly generate sub.

Maybe with Data::Swap, you can work around this problem. I haven't tried yet, but I'm thinking of something like

use Data::Swap; sub myhandler : ATTR(CODE) { my ($p, $s, $r, ...) = @_; swap $r, \my $o; swap $r, sub { # code &$o; }; }
I have no idea if this would work.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

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