use strict; use IO::Socket; my $sock = IO::Socket::INET->new( PeerAddr => '10.0.0.1', PeerPort => 32001, Proto => 'tcp', Timeout => 5, ); my $resp; $sock->send( "UAT" ); sleep 5; # sleep added to slow client down print "done sleeping...receiving...\n"; eval { local $SIG{ALRM} = sub { return ''; }; alarm 15; $sock->recv( $resp, 100 ); alarm 0; }; print $resp, "\n"; $sock->close();