Move Attribute::Handlers from lib to ext. The layout in ext is the same as the
[p5sagit/p5-mst-13.2.git] / ext / Attribute-Handlers / demo / Descriptions.pm
CommitLineData
0e9b9e0c 1package Descriptions;
2$VERSION = '1.00';
3
4use Attribute::Handlers;
5
6my %name;
7
8sub name {
9 return $name{$_[2]}||*{$_[1]}{NAME};
10}
11
12sub UNIVERSAL::Name :ATTR {
13 $name{$_[2]} = $_[4];
14}
15
16sub UNIVERSAL::Purpose :ATTR {
17 print STDERR "Purpose of ", &name, " is $_[4]\n";
18}
19
20sub UNIVERSAL::Unit :ATTR {
21 print STDERR &name, " measured in $_[4]\n";
22}
23
24
251;