in reply to Can't call method "recv" on an undefined value
Printing "Connection to the socket was successful" doesn't make it so. You're getting the error because $socket is not defined (like the error message says), and it's undefined because your new failed. Use the following construct to get a more meaningful error message:
my $socket = IO::Socket::INET->new(...) or die("Unable to create socket: $!\n");
If you're trying to create a server socket, you need to specify a Listen argument. Furthermore, you should probably omit LocalHost.
If you're trying to create a client socket, you need to specify a PeerAddr and the PeerPort argument, and you should remove LocalHost and LocalPort.
|
|---|