| … | |
… | |
| 8 | use strict; |
8 | use strict; |
| 9 | use vars qw(@ISA); |
9 | use vars qw(@ISA); |
| 10 | @ISA = qw(Value); |
10 | @ISA = qw(Value); |
| 11 | |
11 | |
| 12 | use overload |
12 | use overload |
| 13 | '+' => \&add, |
13 | '+' => sub {shift->add(@_)}, |
| 14 | '.' => \&Value::_dot, |
14 | '.' => \&Value::_dot, |
| 15 | 'x' => \&Value::cross, |
15 | 'x' => sub {shift->cross(@_)}, |
| 16 | '<=>' => \&compare, |
16 | '<=>' => sub {shift->compare(@_)}, |
| 17 | 'cmp' => \&Value::cmp, |
17 | 'cmp' => sub {shift->compare_string(@_)}, |
| 18 | 'nomethod' => \&Value::nomethod, |
18 | 'nomethod' => sub {shift->nomethod(@_)}, |
| 19 | '""' => \&stringify; |
19 | '""' => sub {shift->stringify(@_)}; |
| 20 | |
20 | |
| 21 | # |
21 | # |
| 22 | # Make a List out of a list of entries or a |
22 | # Make a List out of a list of entries or a |
| 23 | # reference to an array of entries, or the data from a Value object |
23 | # reference to an array of entries, or the data from a Value object |
| 24 | # |
24 | # |