Nov 1, 2002 #1 EAnnie Programmer Joined Jul 30, 2001 Messages 17 Location 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
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
Nov 1, 2002 #2 raider2001 Technical User Joined Apr 27, 2001 Messages 488 Location US 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"; } Upvote 0 Downvote
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"; }