in reply to Read File in reverse

The following code will fill an array with the lines of a file in reverse order:

open(FILE, "<myfile.txt"); @file = reverse <FILE>; foreach (@file) { #process line }
This will process the file from the last line to the first line.

hope this helps,
davidj

Replies are listed 'Best First'.
Re^2: Read File in reverse
by CountZero (Bishop) on Jun 05, 2004 at 08:27 UTC
    But then you have read the whole file.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law