Subject: | Attempts to sort empty arrays |
I have maintain an array of objects, and have the following sort routine:
sub mysort {
$a->mymethod <=> $b->mymethod
}
Tie::Array::Sort and ::Lazy give the following error:
Can't call method "mymethod" on an undefined value at ...
where the line refers to the location of "mysort" in the code.
The array does not seem to have undefined values. If I do not tie it, but run
sory mysort @array
when I'm done, it works fine. So I suspect that something is trying to call the comparitor on the empty array.