First off, I'm going to go out on a limb and guess that this is some DOS based system. There are numerous problems with running perl on this platform, and one of which is open file handles. Windows9x has limitations to the number of handles it can have open at any one particular time. If there are two many open, then you will not be able to get any more until system resources are free. Handles in Win32 can count as:
- Sockets
- Filehandles
- Handles to binary objects in the registry
I'm not sure exactly what the upper limit is, but it seems that you are hitting it. You may need to make a few tweaks to get this to run. It is quite possible that with all the junk you have running, perl does not have the space to create file handles. Perl has to open a lot of files to get a program up and running, and that may be an issue. If you are using C, all you have to do is open up one file, and launch a socket.
Here are my suggestions on getting it to run. First off, make sure that you have a working IO::Socket program. You didn't post any here, so I'm assuming you have one that works. Here's a really quick and dirty one that doesn't want to do anything complicated.
#!/usr/bin/perl -w
use strict;
use IO::Socket;
my $sock = IO::Socket::INET->new(PeerAddr => 'www.perlmonks.org',
PeerPort => 'http(80)',
Proto => 'tcp') or die "Ack! No so
+cket!";
$sock->write("GET /\r\n\r\n");
my $foo;
$sock->read($foo, 1000000);
print $foo."\n";
Okay, does that run? If it does, than you're hitting the upper limit on complexity in the program. Here are my suggestions if it doesn't:
- Close all running applications. Get a real process killer, but leave GDI, Systray, USER and explorer running. Novell and Norton are real system hogs, so if you could do without it, that may be best.
- In your config.sys, force more handles to be created at startup. Add a line:
FILES=255
- Try to see if there is something else that you can use that is more specific to the task at hand, such as Win32::Internet
- See if you program works if you move a shortcut to it into the startup folder, before items have loaded all up.
- Are you using Winsock2? That might be something you might want to look at. If these lab machines are beyond your control, then find out what version of Winsock there is, and what can be done about it.
- The error may be bogus. The boxes may not have TCP installed. I saw a lab once where that was the case. TCP was emulated over some bizarre Novell configuration. The perl module probably does not know how to account for it.
It's a tough problem if Windows is going to cough at you, but it's quite possibly Novell or the Anti-Virus's part. Reboot the box and see if it works after a cold reboot.
--
jb