#/usr/bin/perl -w # Hello World Client, by Jonadab the Unsightly One # Give it an IP address of a machine running the # hellows.pl server, and it will query that server # for a Hello World response, demonstrating sockets. require 5.002; use sigtrap; use Socket; $serverhost = 'raptor1'; $serverport = 5; use IO::Socket; my $sock = new IO::Socket::INET ( PeerAddr => $serverhost, PeerPort => $serverport, Proto => 'tcp', ); die "Hello World Client unable to create socket: $!\n" unless $sock; print $sock "Hello, are you there, server world?\n"; print <$sock>; close($sock);