> Well, this is the last time I am going to bring this up. I am on Apache
NT,
> and I have the following .pm file that I believe I localized everything in
> order to create a socket. The code below does work.  But it never makes a
> new socket. As you can see I print out the IO::Socket::GLOB and it shows
the
> same 'reference' 10xff036c each time through. I realize this is because I
am
> not closing and undef the $sock. (see the commented close and undef
towards
> the end). But this works. Except if I shut down the machine I am calling
the
> socket on. Then it dies and never comes back unless I reboot apache. Not a
> good work position to get a web site into.
>
> But here is the catch. If I do close the socket and either undef or even
> leave that commented out, I only get one send to the socket, and one
reply,
> but it never sends another reply to the server and never gets another
> response back? But yes, it creates a new socket ref each time?

It looks to me like you have a problem with scoping and closures.  Try
making $sock a global, i.e. change "my $sock;" to "use vars qw($sock);".
Then put your close and undef stuff back in.

- Perrin

Reply via email to