in reply to perl : Passing hash , array through socket program betwen client and server

A couple of things:

  1. You'd almost certainly be better to use Storable freeze/thaw to serialise data for transmission via a socket.

    It packs and unpacks faster; is more compact and therefore transmits faster; and doesn't rely upon eval for unpacking and is therefore safer.

  2. A proto 'tcp' listening port combined with a 'tcp' client connect, does not make for a "UDP server".
    IO::Socket::INET->new(LocalPort=>5000,Proto=>'tcp',Localhost => 'localhost','Listen' => 5 , 'Reuse' => 1 ); die "could not create $! \n" unless ( $socket ); print "\nUDPServer Waiting port 5000\n"; .... my $socket = new IO::Socket::INET ( PeerAddr => $host , PeerPort => $port , Proto => 'tcp', )

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy
  • Comment on Re: perl : Passing hash , array through socket program betwen client and server
  • Download Code