in reply to Net::Telnet - how to detect a reset connection ?

I've run into this same issue and resolved by wrapping calls in an eval block, like below. This only works on *NIX boxes though -- Windows doesn't support signals per se.
my $timeout = 20; my $result = eval { local $SIG{ALRM} = sub { die "timed out\n" }; alarm $timeout; my $result = send_command(); alarm 0; return $result; }; if ($@) { print "command timed out\n"; do_something_else(); }