D
Dave Saville
I am developing a script that uses Net:ing
I need to be able to CTRL-C it and have my END block run.
I have $SIG{INT} = \&catch; at the top of the script;
sub catch
{
$int++;
$SIG{INT} = 'DEFAULT' if $int > 3;
}
In the main program I check for $int being no-zero and exit.
The actual ping is issued from a subroutine.
If the other end is responding then a CTRL-C will stop it and run my
END block. However if the other end is *not* responding then I get
this:
..........
CTRL-C Nothing happens, if I leave it it stays that way and no more
output appears.
CTRL-C
Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be
16 at D:/u
sr/lib/perl/lib/5.8.2/os2/Socket.pm line 370.
Followed by the print from my END block.
What's going on and what have I missed? I am guessing that the
Net:ing code has installed another handler?
TIA
I need to be able to CTRL-C it and have my END block run.
I have $SIG{INT} = \&catch; at the top of the script;
sub catch
{
$int++;
$SIG{INT} = 'DEFAULT' if $int > 3;
}
In the main program I check for $int being no-zero and exit.
The actual ping is issued from a subroutine.
If the other end is responding then a CTRL-C will stop it and run my
END block. However if the other end is *not* responding then I get
this:
..........
CTRL-C Nothing happens, if I leave it it stays that way and no more
output appears.
CTRL-C
Bad arg length for Socket::unpack_sockaddr_in, length is 0, should be
16 at D:/u
sr/lib/perl/lib/5.8.2/os2/Socket.pm line 370.
Followed by the print from my END block.
What's going on and what have I missed? I am guessing that the
Net:ing code has installed another handler?
TIA