Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return code from Net::Telnet

Status
Not open for further replies.

EAnnie

Programmer
Jul 30, 2001
17
CA
Hi
Do you know how can I get the return code of the command called in the cmd method of the net::telnet package.

ex: $t->cmd ("ls");
lets say the ls return 3 as a return code
what is the way to get the return code "3"

tks in advance
Annie
 
The only way I know of is to do something like this:
Code:
$out = $t->cmd("ls || echo FAILED");
if ($out =~ /FAILED/) {
    print "'ls' failed\n";
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top