#!/usr/bin/perl -w use IO::Socket; $message="Hello server!" #Message you send to server my $sock = new IO::Socket::INET ( PeerAddr => "$ip", #The IP of the network of PC2 LocalAddr => "$localip", #The IP of PC2 in the local network PeerPort => '7070', Proto => 'tcp',); die "Could not create socket: $!\n" unless $sock; print $sock "$message\n"; close($sock);} #### #!/usr/bin/perl -w use IO::Socket; my $sock = IO::Socket::INET->new( Proto => 'tcp', LocalPort => 7070, Listen => 1, Reuse => 1, Type => SOCK_STREAM ) or die "Can't create listen socket: $!"; my $new_sock = $sock->accept(); while(<$new_sock>) {$message = $_} close($sock); print "$message";