TASdvlper has asked for the wisdom of the Perl Monks concerning the following question:
I've set up a script to telnet to a remote system and, via Net::Telnet, and execute a command (the remote system is Windows, if that matters). I have little snippet below:
Where if I use the 1st 'if' condition it works fine and the command completes within a minute or so and the script returns. But if I use the second 'if' condition the command seems to run but then it just seems to hang and the script doesn't return back until ~1/2 hour later (where as it was 1 minute using the 1st 'if'). Very confusing to me.if((@output = $telnetObj->cmd("$fileAry[$i]"))) { #works ! # if((@output = $telnetObj->cmd(String => "$fileAry[$i]", Timeout => 1 +20))) { # seems to hang after the script completes
$fileAry[$i] is the command that is too be executed. Which is the same in both cases.
So, here's my question, is using the 1st 'if' statement ok or should I use some type of timeout value (in case the command fails to execute, something happens on the networks, etc). I'm not sure of the best practices in this scenario.
Thanks all ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Have some questions regarding timeout values when using Net::Telnet
by NetWallah (Canon) on Aug 18, 2004 at 18:15 UTC |