File Coverage

blib/lib/perl5i/2/UNIVERSAL.pm
Criterion Covered Total %
statement 25 28 89.2
branch 4 4 100.0
condition 3 3 100.0
subroutine 10 13 76.9
pod 0 9 0.0
total 42 57 73.6


line stmt bran cond sub pod time code
1             package perl5i::2::UNIVERSAL;
2              
3             # Methods which apply to all autoboxed objects.
4             #
5             # They do NOT apply to blessed objects. That should go into perl5i::2::Meta::Instance.
6              
7 103     103   616 use strict;
  103         220  
  103         10726  
8 103     103   3143 use warnings;
  103         213  
  103         18295  
9              
10             require Carp::Fix::1_25;
11              
12             sub alias {
13 918     918 0 8165 my $self = shift;
14              
15 918 100       3307 Carp::Fix::1_25::croak('Not enough arguments given to alias()') unless @_;
16              
17 917         2992 my @name = @_;
18 917 100 100     17646 unshift @name, (caller)[0] unless @name > 1 or grep /::/, @name;
19              
20 917         2785 my $name = join '::', @name;
21              
22             # If this redefines something, assume the user wanted to
23 103     103   594 no warnings 'redefine';
  103         244  
  103         5699  
24 103     103   542 no strict 'refs';
  103         226  
  103         25933  
25 917         10322 *{$name} = $self;
  917         5576  
26 917         3973 return 1;
27             }
28              
29 0     0 0 0 sub is_number { return }
30 3     3 0 1851 sub is_positive { return }
31 3     3 0 1629 sub is_negative { return }
32 0     0 0 0 sub is_even { return }
33 0     0 0 0 sub is_odd { return }
34 3     3 0 1615 sub is_int { return }
35 3     3 0 1481 sub is_integer { return }
36 3     3 0 10585 sub is_decimal { return }
37              
38             1;