in reply to tail -f foo.bar | cat -n
my $count = 0; my $line; # from their POD use File::Tail; # "tail => -1" will start from the beginning of the file my $file=File::Tail->new(name => "/some/log/file", tail => -1); while (defined($line=$file->read)) { print ++$count, " ", $line; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: tail -f foo.bar | cat -n
by ProfessorHaroldHill (Initiate) on Feb 26, 2008 at 10:30 UTC |