jdhedden has asked for the wisdom of the Perl Monks concerning the following question:
It's purpose is to gather user input in an interruptable manner. Theoretically, the eval block should catch the die()s. However, twice my program has terminated due to the die('CHLD EVENT'). I can only guess that it's due to the receipt of multiple signals simultaneously. I cannot reproduce the behaviour with a test program, and it has only occurred twice during several tens of hours of operation.eval { local $SIG{'ALRM'} = sub { $STATE{'EVENT'} = 1; die('ALRM EVENT'); }; local $SIG{'CHLD'} = sub { $STATE{'EVENT'} = 1; die('CHLD EVENT'); }; if (! $STATE{'EVENT'}) { $cmd = <STDIN>; } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Eval not catching Dies (local)
by tye (Sage) on Dec 08, 2003 at 17:34 UTC | |
|
Re: Eval not catching Dies
by Coruscate (Sexton) on Dec 08, 2003 at 17:44 UTC | |
by Anonymous Monk on Dec 08, 2003 at 19:02 UTC | |
by Anonymous Monk on Dec 08, 2003 at 19:16 UTC | |
|
Re: Eval not catching Dies
by ambrus (Abbot) on Dec 09, 2003 at 07:15 UTC | |
|
Re: Eval not catching Dies
by Abigail-II (Bishop) on Dec 08, 2003 at 16:13 UTC |