Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 romping around the Monastery: (18)
As of 2014-08-27 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (244 votes), past polls