my $o_tail=File::Tail->new( name => $scan_log_file, maxinterval => 1, adjustafter => 1, ignore_nonexistant => 1, reset_tail => -1, tail => -1, ); while( my $line = $o_tail->read() ) { if( $line =~ m/finished/ ) { # Do stuff } }