Well, AFAIK IO::Socket returns undef upon failure, and will have a hard time closing an undefined variable. In this case you should change your code to:
if ($disco)
{
print "$host FAILED to respond on $service $ports{$service}\n";
}
else
{
close $checkport;
}
I couldn't find IO::Socket's return value when failing in it's documentation, but that it calls connect(), and this returns false when failing. I can't imagine that it (IO::Socket) would return a socket even when failing to open one, so my guess is that this is your mistake. I don't use IO::Socket all that often, so I might be wrong here.. Hope this helps ;)
-octo-