tail display ....in perl

hi
we have 3 servers and we have a script to monitor cpu usage of all 3 servers and writes into one file on one of the server where we monitor all those servers ( by doing tail -f filename ) so we decided to create script ( perl ) that will read values from this file and display it should be like "top" command it will refresh on its own without quitting ...can u guys provide me ideas ?

sample log file is as follows :

20080115_172824_Hpux1571        801     Hpux1571        0       0
20080115_172826_Hpux1570        801     Hpux1570        6       0
20080115_172832_Hpux1572        801     Hpux1572        65      0
20080115_172835_Hpux1571        801     Hpux1571        0       0
20080115_172838_Hpux1570        801     Hpux1570        1       0
20080115_172844_Hpux1572        801     Hpux1572        60      0
20080115_172847_Hpux1571        801     Hpux1571        0       0
20080115_172849_Hpux1570        801     Hpux1570        6       0

my current scripts prints like this :

Hpux1571       :       0
 Hpux1570       :       6
 Hpux1572       :       65
 Hpux1571       :       0
 Hpux1570       :       1
 Hpux1572       :       60

it should display like :

$tailit.pl  
Hpux1570      :        6
Hpux1571      :        0
Hpux1572      :        65

extracting values is not a problem , problem is that displaying only latest values from them .....
suggest something ...

I guess there's more than one way to do it, as perl suggests :slight_smile:
First, by using "Fail-Tail or using seek, a suggestions from Larry :slight_smile:

thanx for ur reply ..
but getting information from file is done ...with File::Tail module i want to display such way that only latest values for each server will be displayed ..
like its shown in top command on HP-UX page keeps on refreshing till u hit <CNTR-C>
to make it more simple
its should update server CPU usage only without quitting ..

server name :     cpu usage 
hpux1571     :    cpu usage refreshing *
hpux1570     :    cpu usage refreshing * 
hpux1572     :    cpu usage refreshing *

only lines marked with "*" should change as soon as they find new value for that server in logfile.