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

I just found and tried this code, still no luck. It still takes 20 to 30 seconds to regain control. From Chapter 18. The UDP Protocol, in "Network Programming with Perl".

eval { local $SIG{ALRM} = sub { die "timeout\n" }; alarm(2); $t = new Net::Telnet (Host => $host, Port => $port, Timeout => 1, Prompt => '/Escape character is.+\n/', Rs => ' ', Ors => '', Binmode => 1, Telnetmode => 1, Errmode => 'return'); alarm(0); }; if ($@) { die $@ unless $@ eq "timeout\n"; warn "Timed out!\n"; }

Replies are listed 'Best First'.
Re^4: Timeout parameter for Net::Telnet under Windows
by SwaJime (Scribe) on Jan 28, 2016 at 21:28 UTC

    I also tried ualarm() from Time::HiRes;

    For that it's even worse. I get "Time::HiRes::ualarm(): unimplemented in this platform"

    *sigh*