Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: how to populate array with last 20 lines of file

by shadowsong (Pilgrim)
on Aug 08, 2017 at 21:23 UTC ( #1197043=note: print w/replies, xml ) Need Help??


in reply to Re^2: how to populate array with last 20 lines of file
in thread how to populate array with last 20 lines of file

Try it again, but like this:

#!perl -slw use strict; use File::Tail; my $logfile = File::Tail->new( name => 'logfile.txt' # daily logfile ,maxinterval => 5 # poll logfile every 5 seconds ,interval => 3 # wait 3 seconds before initial 'tail' ,tail => 5 # give me last 5 lines ); print while(defined($_ = $logfile->read));

Best Regards,
Shadowsong

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2019-07-19 10:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?