#!/usr/bin/perl use FileHandle; use TCP::Client; @ARGV = ('localhost') unless @ARGV; STDOUT->autoflush(1); for $host ( @ARGV ) { printf "%12s:", $host; $fh = tcp_connect ($host, 'daytime'); # print "<$fh> "; print <$fh>; close $fh; }