Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

timeout for system commands - perl

 
SOLVED
Go to solution
Highlighted
itai weisman
Super Advisor

timeout for system commands - perl

Hi,
on perl script,
does anyone know a way to fail a system function call, if it takes too much time,
(maybe by using another function or module)
f.e.
if I'm using
system("command1");
and command1 takes too much time (or even hangs)
the whole script hangs....
any idea?



3 REPLIES 3
Highlighted
Peter Godron
Honored Contributor
Solution

Re: timeout for system commands - perl

Hi,
not sure if this is what you are after:
http://perldoc.perl.org/functions/alarm.html

Can you not timeout the call, once your expected execution time has elapsed?
Highlighted
Joel Girot
Trusted Contributor

Re: timeout for system commands - perl

Highlighted
itai weisman
Super Advisor

Re: timeout for system commands - perl

10x