emilbarton has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I have a CGI script calling an external client to gather data from a remote SQL server. Now sometimes for various reasons the process doesn't stop or worse, loops furiously, and I'd like the CGI to be able at least to record the pid and stop it after timeout. Below an example of this external call. I'm sure I'd be able to tinker some solution on my own, but I'm asking your wisdom for a good solution. Thank you in advance.
open MYPIPE, "-|", "$UNID_CLIC $Host $Port $Base $User $Passwd $Query" or ($RSLT = "Can't pop: $!"); while (<MYPIPE>) { $RSLT .= decode utf8=>$_; } close MYPIPE; my @rslt = split /$RES_STX/, $RSLT;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to handle an external process from CGI?
by haukex (Archbishop) on Jun 21, 2019 at 22:21 UTC | |
by emilbarton (Scribe) on Jun 21, 2019 at 22:32 UTC | |
by haukex (Archbishop) on Jun 22, 2019 at 08:40 UTC | |
Re: How to handle an external process from CGI?
by Anonymous Monk on Jun 28, 2019 at 06:35 UTC |
Back to
Seekers of Perl Wisdom