File Coverage

blib/lib/Attribute/Alias.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 25 27 92.5


line stmt bran cond sub pod time code
1             package Attribute::Alias;
2              
3 5     5   27 use warnings;
  5         12  
  5         157  
4 5     5   26 use strict;
  5         9  
  5         141  
5 5     5   26 use Attribute::Handlers;
  5         8  
  5         31  
6              
7             our $VERSION = sprintf "%d.%02d", q$Revision: 1.2 $ =~ /(\d+)/g;
8              
9             sub UNIVERSAL::Alias : ATTR {
10 1     1 0 1473 my ($pkg, $symbol, $data) = @_[0,1,4];
11 5     5   440 no strict 'refs';
  5         8  
  5         452  
12 1 50       6 *{"$pkg\::$_"} = $symbol for ref $data eq 'ARRAY' ? @$data : $data;
  1         8  
13 5     5   34 }
  5         9  
  5         28  
14              
15             "Rosebud"; # for MARCEL's sake, not 1 -- dankogai
16              
17             __END__