Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How to read last lines from file?

by zentara (Archbishop)
on Nov 02, 2011 at 17:04 UTC ( #935443=note: print w/replies, xml ) Need Help??


in reply to How to read last lines from file?

#!/usr/bin/perl -w use strict; use File::Tail; my $log = "/usr/local/apache2/logs/access_log"; my $file=File::Tail->new ( name=>$log, interval=>2, maxinterval=>10 ); while (defined(my $line=$file->read)) { print "$line"; }

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935443]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2016-09-26 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (478 votes). Check out past polls.