Attribute-Handlers

 view release on metacpan or  search on metacpan

lib/Attribute/Handlers.pm  view on Meta::CPAN



=head1 DESCRIPTION

This module, when inherited by a package, allows that package's class to
define attribute handler subroutines for specific attributes. Variables
and subroutines subsequently defined in that package, or in packages
derived from that package may be given attributes with the same names as
the attribute handler subroutines, which will then be called in one of
the compilation phases (i.e. in a C<BEGIN>, C<CHECK>, C<INIT>, or C<END>
block). (C<UNITCHECK> blocks don't correspond to a global compilation
phase, so they can't be specified here.)

To create a handler, define it as a subroutine with the same name as
the desired attribute, and declare the subroutine itself with the  
attribute C<:ATTR>. For example:

    package LoudDecl;
    use Attribute::Handlers;

    sub Loud :ATTR {



( run in 0.595 second using v1.01-cache-2.11-cpan-4ee56698ea0 )