At 10:09 +0000 1/12/04, Tim Bunce wrote:
On Sun, Jan 11, 2004 at 10:15:20PM -0500, Lincoln A. Baxter wrote:
 >    eval {
 >       local $SIG{ALRM} = sub { ... };
 >    }
Either way your Sys::SigAction is sufficient. The only thing it's
lacking that Sys::Signal has is the automatic restoration of the old
value when the object is destroyed. It would be trivial to add a
variant of sig_set_action() to do that for those that want it.
Something along the lines of:

  sub sig_set_action_auto_restore {
    my $class = shift;
    return bless sig_set_action(@_), $class;
  }
  sub DESTROY {
    shify->sig_set_action();
  }

I'm not sure whether this is relevant here, but I seem to recall a bug reported sometime in the past 3 weeks about signals not being restored at the right time when using eval. You might want to p5p archives for that.



Liz

Reply via email to