Attribute::Util - Assorted general utility attributes


Attribute-Util documentation Contained in the Attribute-Util distribution.

Index


Code Index:

NAME

Top

Attribute::Util - Assorted general utility attributes

SYNOPSIS

Top

  # makes all attributes available
  use  Attribute::Util;

  # or you can load individual attributes 
  use Attribute::Util qw(Memoize SigHandler);

DESCRIPTION

Top

When used without argument, this module provides four universally accessible attributes of general interest as follows:

Abstract

See Attribute::Abstract.

Alias

See Attribute::Alias.

Memoize

See Attribute::Memoize.

Method

See Attribute::Method.

SigHandler

See Attribute::SigHandler.

When used with arguments, this module acts as an attributes loader.

  use Attribute::Util qw/Memoize SigHandler/;

Is exactly the same as

  use Attribute::Memoize; use Attribute::SigHandler;

Theoretically, you can load any other attribute handlers so long as it is named Attribute::AnyThing.

BUGS

Top

None known so far. If you find any bugs or oddities, please do inform the author.

AUTHOR

Top

Marcel Grunauer, <marcel@codewerk.com>

Dan Kogai, <dankogai@dan.co.jp>

COPYRIGHT

Top

SEE ALSO

Top

perl(1), Attribute::Handlers


Attribute-Util documentation Contained in the Attribute-Util distribution.

package Attribute::Util;

use warnings;
use strict;
use Attribute::Handlers;
use Carp ();

our $VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)/g;
our @DEFAULT_ATTRIBUTES = qw(Abstract Alias Memoize Method SigHandler);

sub import{
    my $pkg = shift;
    my @attrs = @_ ? @_ : @DEFAULT_ATTRIBUTES;
    for my $attr (@attrs){
	eval qq{ require Attribute::$attr; };
	$@ and Carp::croak $@;
	# import is not neccessary for Attribute modules.
    }
}

"Rosebud"; # for MARCEL's sake, not 1 -- dankogai

__END__