Well if you want to read a file backwards, instead of reading from 1.. $lines(file), read from $lines(file) .. 1