Attribute-Handlers

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


        my $next : Cycle(['A'..'Z']);

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 "BEGIN", "CHECK", "INIT", or "END"
    block). ("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
    ":ATTR". For example:

        package LoudDecl;
        use Attribute::Handlers;

        sub Loud :ATTR {

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 {

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 2.844 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-c30982ac1bc3 )