#! /usr/bin/perl -w use diagnostics; use strict; use Socket; my $sin = sockaddr_in 2345, inet_aton 'hermes.cam.ac.uk'; for (@ARGV) { socket HERMES, PF_INET, SOCK_STREAM, getprotobyname 'tcp' or die "Couldn't create socket: $!"; connect HERMES, $sin or die "Couldn't connect: $!"; send HERMES, "$_\015\012", 0; my $text; recv HERMES, $text, 256, MSG_WAITALL; print((split /\n/, $text, 2)[1]); close HERMES; }