in reply to Re^2: Split Help
in thread Split Help

$#lines contains the last index of the array @lines which may or may not be one less than the actual number of elements in the array @lines.   To get the actual number of elements of an array you must use the array in scalar context:

print scalar @lines, "\n";