I had the model for CODE attributes in mind which happen at compile time:
(excerpt from attributes )
sub foo : lvalue ;
use attributes X => \&foo, "lvalue";
That's why Attribute::Handlers is putting such emphasis onto the compilation phase when the association happens.
but LEXICAL attributes seem to call import with each declaration at run-time (which is consistent with the fact that my has a compile and a run-time effect.)
my $cat : Nervous;
use attributes ();
attributes::->import(Felis => \$cat, "Nervous");
maybe Attribute::Handlers should be clearer about this?
> There are ways how not to be wrong.
(A disturbance in the Force happens)
Now more potential in using attributes I see ... ;-) ¹
¹) to be more specific ... this behaviour means that the untie happens almost immediately after the tie, i.e. the potential for possible ugly side effects is practically zero.