Hi,
On Thu, 28 Sep 2006 20:50:05 +0200, James Golovich wrote:
...
> I really don't like the idea of hangup_aware, but I'm not opposed to
> adding it as long as it doesn't become the default.
Sure it should not be default - at least for the backward compatibility.
> I am curious about
> what you have it printing though. It looks like when it catches a
> signal (assuming its SIGHUP) it will print "Line hangup got SIG'.HUP.'"
> I'm not sure if it was your intention to have the be ".$_." instead of
> '.$_.'
Oops, there is really a typo, sorry. I was using myself this code:
use Carp qw(confess cluck);
# We will really get SIGHUP on the line hangup.
for (qw(HUP PIPE)) {
$SIG{$_}=eval "sub { cluck 'INFO: Got signal SIG$_'; };";
}
but it uses &Carp::cluck so I did not want to mess in there.
But maybe it is even appropriate.
Regards,
Jan
> >>+sub hangup_aware {
> >>+ my ($self) = @_;
> >>+
> >>+ # We will really get SIGHUP on the line hangup.
> >>+ for (qw(HUP PIPE)) {
> >>+ $SIG{$_}=eval 'sub { warn "Line hangup - got SIG'.$_.'\n";
> >>};';
> >>+ }
> >>+
> >>+ return 0;
> >>+}