home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _ea9bd9482d0087b83ca5ee3fd9ef4850 < prev    next >
Encoding:
Text File  |  2004-06-01  |  375 b   |  26 lines

  1. package Descriptions;
  2. $VERSION = '1.00';
  3.  
  4. use Attribute::Handlers;
  5.  
  6. my %name;
  7.  
  8. sub name {
  9.     return $name{$_[2]}||*{$_[1]}{NAME};
  10. }
  11.  
  12. sub UNIVERSAL::Name :ATTR {
  13.     $name{$_[2]} = $_[4];
  14. }
  15.  
  16. sub UNIVERSAL::Purpose :ATTR {
  17.     print STDERR "Purpose of ", &name, " is $_[4]\n";
  18. }
  19.  
  20. sub UNIVERSAL::Unit :ATTR {
  21.     print STDERR &name, " measured in $_[4]\n";
  22. }
  23.  
  24.  
  25. 1;
  26.