Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: Watch log for string (tail -f)

by bimleshsharma (Beadle)
on Oct 12, 2012 at 07:39 UTC ( #998625=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Watch log for string (tail -f)
in thread Watch log for string (tail -f)

Try this, May this will help

use File::Tail; sub reading_updated_file { my $path=shift; my $count=0; my $file=File::Tail->new($path); while(defined (my $read=$file->read)) { if($read =~ /string_to_match/) { $count++; last if $count ==3; } print "here doing rest statements"; } } &reading_updated_file("path of file_to tail");


Comment on Re^4: Watch log for string (tail -f)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-09-23 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (216 votes), past polls