Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/bin/perl use Term::ANSIColor; use Term::ANSIColor 2.00 qw(:pushpop); use File::Tail; my $file=File::Tail->new("output.txt"); my $last_time = time(); my $line_count = 0; while (defined($line=$file->read )){ if ( time() > $last_time ){ $last_time = time(); open(FILE, "output.txt"); @lines = <FILE>; close(FILE); $num = @lines; system 'clear'; print colored("Bots p/s: $line_count\n", "green"); print colored("Total Bots: $num\n", "green"); print " \n \n \n"; print color 'reset'; $line_count = 0; } $line_count++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading the average of a changing varible
by hdb (Monsignor) on Feb 23, 2014 at 09:17 UTC |