I'm a beginner in perl programing and got stuck at one point in my code.

The script is used to run a cpp code that will acquire data from an acquisition card.

The problem is I can't stop the script which calls the acquisition program to stop at some point of time unless I press ctrl C. So I tried with the script which I have given below to do the process, but it is not stopping. the condition which I used is also given in the shorter version of my code.

Please tell me what I can do to stop that command. Thanks in advance, kk.

Found in C:\Perl\lib\pods\perlfaq8.pod How do I timeout a slow event? Use the "alarm()" function, probably in conjunction with a signal handler, as documented in "Signals" in perlipc and the section on "Signals" in the Camel. You may instead use the more flexible "Sys::AlarmCall" module available from CPAN.

The "alarm()" function is not implemented on all versions of Windows. Check the documentation for your specific version of Perl.