use strict; use IO::Socket; my $host = 'pdp11.mydomain.net'; my $port = 6740; my $socket = new IO::Socket::INET(PeerAddr => $host, PeerPort => $port, Proto => 'tcp'); die "cannot open socket" unless ($socket); #send a custom command to the PDP-11 server my $cmd = "GIMME\n"; print $socket $cmd; # print the server's response to the gimme request while (<$socket>) { print; } close $socket;