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");
In reply to Re^4: Watch log for string (tail -f)
by bimleshsharma
in thread Watch log for string (tail -f)
by hmb104
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |