in reply to how to use attributes?

No, only the attributes listed in the documentation you reference are supported. E.g. "locked" is supported but "Constructor" isn't.

Correction: "Arbitrary" attributes need a handling subroutine (of the same name as the attribute) to be defined in your class. That facility also needs to be turned on using Attribute::Handlers. Your code will then only work on v5.6.0 of Perl onwards and so should therefore formally require that version (or a later one if otherwise appropriate). For example:

require v5.6.0; use Attribute::Handlers; package Whatever; #... sub Mutator : ATTR{CODE} { my ( $package, $symbol, $referent, $attr, $data ) = @_; # ... do whatever you want with mutators }
User-defined attributes can apply to other types, not just CODE as also explained in the documentation.

-M

Free your mind