in reply to Re^2: trying to implement file tail with regular expression
in thread trying to implement file tail with regular expression
Hello mkhayat, and welcome to the Monastery!
the issue is once I reach to while (<DIAG>) it hang for some reason.
The nested loops in the MAIN code have the following structure:
while (<DIAG>){ while (1) { open LOGFILE, ">>$app_root_dir/logs/detailedlog.log"; while ($line = <DIAG>) { if ($line =~ /is higher than 5 seconds/) { if ($clock == 0) { $clock = 60; # call "print LOGFILE" then "system(...)", 4 times } $clock --; sleep(1); } close LOGFILE; } sleep(65); } }
There are at least 3 problems here:
In addition, you still have calls to sleep although GotToBTru advised that they are not needed when using the File::Tail module.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: trying to implement file tail with regular expression
by mkhayat (Initiate) on Feb 16, 2016 at 08:47 UTC | |
by poj (Abbot) on Feb 16, 2016 at 12:01 UTC | |
by mkhayat (Initiate) on Feb 17, 2016 at 05:29 UTC | |
by poj (Abbot) on Feb 17, 2016 at 07:40 UTC | |
by Anonymous Monk on Feb 17, 2016 at 08:11 UTC | |
|