| 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 | use strict; | ||
| 8 | use warnings; | ||
| 9 | |||
| 10 | require Carp::Fix::1_25; | ||
| 11 | |||
| 12 | sub alias { | ||
| 13 | my $self = shift; | ||
| 14 | |||
| 15 | Carp::Fix::1_25::croak('Not enough arguments given to alias()') unless @_; | ||
| 16 | |||
| 17 | my @name = @_; | ||
| 18 | unshift @name, (caller)[0] unless @name > 1 or grep /::/, @name; | ||
| 19 | |||
| 20 | my $name = join '::', @name; | ||
| 21 | |||
| 22 | # If this redefines something, assume the user wanted to | ||
| 23 | no warnings 'redefine'; | ||
| 24 | no strict 'refs'; | ||
| 25 | *{$name} = $self; | ||
| 26 | return 1; | ||
| 27 | } | ||
| 28 | |||
| 29 | sub is_number { return } | ||
| 30 | sub is_positive { return } | ||
| 31 | sub is_negative { return } | ||
| 32 | sub is_even { return } | ||
| 33 | sub is_odd { return } | ||
| 34 | sub is_int { return } | ||
| 35 | sub is_integer { return } | ||
| 36 | sub is_decimal { return } | ||
| 37 | |||
| 38 | 1; |