in reply to How would I print the last element of a loop?

Typically, you would use a variable to keep track of the largest, as you read through the file.

If you want to print only the last line of a file, you could do

while (<>) { print if eof }

The PerlMonk tr/// Advocate