in reply to Best way to read a file into memory and use normal operation on memory file?
Or, if it is a text file, use the File::ReadBackwards module to read the file backwards line by line and reverse each line.