package AnonArray; # Quick demo of how Sortable works use Sortable; @ISA = ('Sortable'); sub cmp { my $self = shift; my $other = shift; my $len = @$self > @$other ? @$self : @$other; for (0..($len - 1)) { if (my $res = $self->[$_] cmp $other->[$_]) { return $res; } } if ($len < @$self) { return 1; } elsif ($len < @$other) { return -1; } else { return 0; } } sub new { my $class = shift; return bless [@_], $class; } 1;