in reply to tailing the file and look for string
Extracting the pertinent parts of your code we see this:
sub log_watch { ... my $timestamp = 0; ... if ( $line =~ m/^(\d+\/\d+\/\d+\s\d+\:\d+\:\d+\.\d+)/msx ) { $timestamp = $1; } ... return $timestamp; }
From which we can conclude that as $timestamp is still zero at the return point, your regex does not ever match $line. So, either your regex is wrong or $line is not what you think it is, or your log_watch method returns before $line is even tested or you have no entries in $self->{'stdout'}.
|
|---|