in reply to Re^2: Timeout parameter for Net::Telnet under Windows
in thread Timeout parameter for Net::Telnet under Windows

I haven't tried this on Windows yet so your mileage may vary.

#!/bin/env perl use strict; use warnings; use Net::Telnet; my $host = '192.168.130.112'; # valid host that is offline my $port = 10001; print "DEBUG 1\n"; my $t = new Net::Telnet ( Port => $port, Prompt => '/Escape character is.+\n/', Rs => ' ', Ors => '', Binmode => 1, Telnetmode => 1, Errmode => 'return'); print "DEBUG 2\n"; if (!$t) { die "Failed to create telnet object\n"; } $t->open(Host => $host, Timeout => 1) or die "Failed to create telnet session\n";

Replies are listed 'Best First'.
Re^4: Timeout parameter for Net::Telnet under Windows
by SwaJime (Scribe) on Jan 22, 2016 at 19:44 UTC
    I tried this. The results are the same. It is taking 20 to 30 seconds before it times out.

      Bummer. I tried using $t->SUPER::timeout(1) but it generated an error so I removed it before posting.