Subject: | Misuse of length on array |
$ ack 'length\s*\(\s*@'
lib/MorboDB/Cursor.pm
399: splice(@docs, $self->_limit, length(@docs) - $self->_limit)
length() only applies to scalars, so length(@docs) will evaluate @docs in scalar context, which
returns the number of elements. That number will be passed to length(), which will tell you how
many digits there are. So you just end up using the wrong number in the calculations.
You just need:
splice(@docs, $self->_limit, @docs - $self->_limit)