Subject: | untie attempted in Net::Server while inner reference still exists [WITH FIX] |
I'm using Net::Server::HTTP, server_type => PreFork, and port of
8080/ssleay, thus using Net::Server::Proto::SSLEAY. When a connection
is finished (in my case, using LWP), I get a bunch of these:
untie attempted while 1 inner references still exist at
/home/perl/5.8.8/lib/site_perl/5.8.8/Net/Server.pm line 942 (#1)
(W untie) A copy of the object returned from tie (or tied) was
still valid when untie was called.
After some hacking, I found that it was the following two lines in
Net::Server (which is only somewhat obvious from the error message -
what wasn't obvious is that the problem is here, too):
untie *STDOUT if tied *STDOUT;
untie *STDIN if tied *STDIN;
And the solution was found in Net::Server::Multiplex's _unlink_stdout
function. I replaced the above lines with:
my $x = tied *STDOUT;
if ($x) {
undef $x;
untie *STDOUT;
}
$x = tied *STDIN;
if ($x) {
undef $x;
untie *STDIN;
}
And the errors went away.