in reply to Skipping to the End of a File

I dont know how much slower this is, than the other options, but I normally would use:
open(file,"<file.txt"); foreach (reverse <FILE>) { print $_; last; } close(file);

BatGnat

This project cannot be completed successfully as we require - a shrubbery!

Replies are listed 'Best First'.
Re: Re: Skipping to the End of a File
by danger (Priest) on Jan 15, 2001 at 09:43 UTC

    That's not really an efficient solution -- it reads the entire file into memory as a list of lines and then reverses that list before entering the loop block. The previous solutions using seek() or File::Tail are better options.