I have a simple perl script that calls a shell script which for whatever reason "hangs". I want to simply force a time out after 20 seconds. I did a lot of research and was brought to perl Alarms. It works when I test with sleep(), but when running the shell script the alarm doesn't kick in. Can someone please help???? Here is my code. Thanks in Advance.

I tried your code but since i dont have the shell script i used something else... it reported after 20 seconds.... I think its the shell script is returning isnt not finished yet and is waiting for it to, so its just hanging.

This is a CGI script. The web server is waiting for the shell script to finish, because the shell script still has an open file handle to the standard output. How do I force a timeout, alarms doesn't seem to work.