in reply to Re^2: how to populate array with last 20 lines of file
in thread how to populate array with last 20 lines of file

Yeah .. not surprising, since you tail the file once, and then stop.

Why not read it, sleep for a minute, then read it again, as your original script tried to do?

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re^4: how to populate array with last 20 lines of file
by ytjPerl (Scribe) on Aug 08, 2017 at 18:08 UTC
    in original script, the purpose of sleep() is to compare if the size of file changes. And Tail still does not solve my problem of only populating an array with last few lines of file, so does Readbackwards.