in reply to Kill a child nicely

You can't use alarm to wake up and check some status or flag? Try::ALRM seems like a nice wrapper around it.

Replies are listed 'Best First'.
Re^2: Kill a child nicely
by Melly (Chaplain) on Sep 15, 2023 at 14:52 UTC

    Well, that's interesting - I'll have play (although I note that this might not work on Windows - (Win32) Emulated using timers that must be explicitly polled whenever Perl wants to dispatch "safe signals" and therefore cannot interrupt blocking system calls.)

    map{$a=1-$_/10;map{$d=$a;$e=$b=$_/20-2;map{($d,$e)=(2*$d*$e+$a,$e**2 -$d**2+$b);$c=$d**2+$e**2>4?$d=8:_}1..50;print$c}0..59;print$/}0..20
    Tom Melly, pm (at) cursingmaggot (stop) co (stop) uk
      this might not work on Windows

      Exactly. Windows has no concept of signals. And the only way to terminate a process from the outside is a nasty trick that makes the victim process commit suicide (see Re: Handling killing the perl process).

      So, are you on Windows or Unix? Knowing that inforrmation will get you more useful answers. Most answers you got so far are for Unix and won't work on Windows.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        Oof .. missed this is on Windows. Carry on!