On 12/6/06, hOURS <[EMAIL PROTECTED]> wrote:

                  My program in a nutshell goes:
  Blah blah blah the beginning part
  require  someprogramthatmayhaveaninfiniteloop.pl
  Blah blah blah the ending part

You must have a good reason for using a buggy library without first
fixing its bugs.

How would one add  alarm to this such that the ending part gets executed
regardless?

It's difficult to live up to the word "regardless", especially so when
alarm is involved. As an alternative, have you considered using a
child process to do the long-running calculation? It can get stuck in
an infinite loop, but your parent process isn't. Your parent process
can check each second whether the child has finished until N seconds
have elapsed; then the parent sends SIGHUP to the child and it's done.

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to