in reply to Printing the last few elements of an array.
About 'the question you asked' in the second snippet: you got out a number, repeated 5 times, right?
This is because you wrote $line=@record, which means: assign to $line the number of elements in the array @record.
This happens because assigning to a scalar variables sets scalar context for the right-hand side of the assignment, and an array in scalar context evaluates to its lenght.
-- dakkar - Mobilis in mobile