Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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


Comment on Re: How to read last lines from file?
Download Code

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 pondering the Monastery: (9)
As of 2014-10-23 08:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls